Skip to content

Commit

Permalink
tests: update tests and snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
mrholek committed Jul 7, 2024
1 parent 8ab945e commit 54c1df1
Show file tree
Hide file tree
Showing 16 changed files with 67 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ test('loads and displays CButtonGroup component', async () => {
test('CButtonGroup customize', async () => {
const { container } = render(
<CButtonGroup className="bazinga" size="lg" vertical={false}>
<CButton>Test A</CButton>
<CButton>Test B</CButton>
<CButton>Test C</CButton>
<CButton color="primary">Test A</CButton>
<CButton color="primary">Test B</CButton>
<CButton color="primary">Test C</CButton>
</CButtonGroup>,
)
expect(container).toMatchSnapshot()
Expand All @@ -25,9 +25,9 @@ test('CButtonGroup customize', async () => {
test('CButtonGroup customize vertical', async () => {
const { container } = render(
<CButtonGroup className="bazinga" size="lg" vertical={true}>
<CButton>Test A</CButton>
<CButton>Test B</CButton>
<CButton>Test C</CButton>
<CButton color="primary">Test A</CButton>
<CButton color="primary">Test B</CButton>
<CButton color="primary">Test C</CButton>
</CButtonGroup>,
)
expect(container).toMatchSnapshot()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ test('CButtonToolbar customize', async () => {
const { container } = render(
<CButtonToolbar className="bazinga" role="group" aria-label="Bazinga">
<CButtonGroup role="group">
<CButton>1</CButton>
<CButton>2</CButton>
<CButton>3</CButton>
<CButton color="primary">1</CButton>
<CButton color="primary">2</CButton>
<CButton color="primary">3</CButton>
</CButtonGroup>
<CButtonGroup role="group">
<CButton>A</CButton>
<CButton>B</CButton>
<CButton>C</CButton>
<CButton color="primary">A</CButton>
<CButton color="primary">B</CButton>
<CButton color="primary">C</CButton>
</CButtonGroup>
</CButtonToolbar>,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import '@testing-library/jest-dom'
import { CButton } from '../../../index'

test('loads and displays CButton component', async () => {
const { container } = render(<CButton>Test</CButton>)
const { container } = render(<CButton color="primary">Test</CButton>)
expect(container).toMatchSnapshot()
})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ test('loads and displays CDropdownToggle component', async () => {

test('CDropdownToggle customize', async () => {
const { container } = render(
<CDropdownToggle caret={true} split={true} trigger="focus">
<CDropdownToggle caret={true} color="primary" split={true} trigger="focus">
Test
</CDropdownToggle>,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ exports[`CDropdown example 1`] = `
>
<button
aria-expanded="false"
class="btn btn-primary dropdown-toggle"
class="btn dropdown-toggle"
tabindex="0"
type="button"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ exports[`CDropdownToggle customize 1`] = `
exports[`loads and displays CDropdownToggle component 1`] = `
<div>
<button
class="btn btn-primary dropdown-toggle"
class="btn dropdown-toggle"
tabindex="0"
type="button"
>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react'
import { render, fireEvent } from '@testing-library/react'
import '@testing-library/jest-dom/extend-expect'
import '@testing-library/jest-dom'
import { CModal } from '../../../index'

test('loads and displays CModal component', async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,39 @@

exports[`CNavItem customize 1`] = `
<div>
<li
<h3
class="nav-item bazinga"
>
<h3
<a
aria-current="page"
aria-disabled="true"
class="nav-link bazinga active disabled"
disabled=""
href="/bazinga"
tabindex="-1"
>
Test
</h3>
</li>
</a>
</h3>
</div>
`;

exports[`CNavItem customize 2`] = `
<div>
<li
<h3
class="nav-item bazinga"
>
<h3
<a
aria-current="page"
aria-disabled="true"
class="nav-link bazinga active disabled"
disabled=""
href="/bazinga"
tabindex="-1"
>
Test
</h3>
</li>
</a>
</h3>
</div>
`;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { CPopover, CButton } from '../../../index'
test('loads and displays CPopover component', async () => {
const { container } = render(
<CPopover content="A">
<CButton>Test</CButton>
<CButton color="primary">Test</CButton>
</CPopover>,
)
expect(container).toMatchSnapshot()
Expand All @@ -17,7 +17,7 @@ test('CPopover customize', async () => {
let arr, element
const { container } = render(
<CPopover content="content" title="title" trigger="click" placement="right">
<CButton>Test</CButton>
<CButton color="primary">Test</CButton>
</CPopover>,
{ container: document.body },
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,33 @@
exports[`CPopover customize 1`] = `
<body>
<button
aria-describedby="popover744956"
class="btn btn-primary"
type="button"
>
Test
</button>
<div
class="popover bs-popover-auto fade show"
id="popover744956"
role="tooltip"
style="position: absolute; left: 0px; top: 0px; margin: 0px;"
>
<div
class="popover-arrow"
style="position: absolute;"
/>
<div
class="popover-header"
>
title
</div>
<div
class="popover-body"
>
content
</div>
</div>
</body>
`;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@

exports[`CSidebarBrand customize 1`] = `
<div>
<div
<a
class="sidebar-brand bazinga"
>
Test
</div>
</a>
</div>
`;

exports[`loads and displays CSidebarBrand component 1`] = `
<div>
<div
<a
class="sidebar-brand"
color="primary"
>
Test
</div>
</a>
</div>
`;
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,18 @@ exports[`CSidebarNav customize 1`] = `
<div>
<ul
class="sidebar-nav bazinga"
/>
>
Test
</ul>
</div>
`;

exports[`loads and displays CSidebarNav component 1`] = `
<div>
<ul
class="sidebar-nav"
/>
>
Test
</ul>
</div>
`;
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
exports[`CTabPane customize 1`] = `
<div>
<div
class="tab-pane fade active show bazinga"
class="tab-pane active fade show bazinga"
>
Test
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ exports[`CToaster customize 1`] = `
class="toaster toast-container bazinga"
/>
<button
class="btn btn-primary"
class="btn"
type="button"
>
Send a toast
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
exports[`CTooltip customize 1`] = `
<div>
<a
aria-describedby="tooltip97108"
class="link"
>
Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ exports[`CWidgetStatsC customize 1`] = `
class="card-body"
>
<div
class="text-end mb-4"
class="text-end mb-4 text-white text-opacity-75"
>
icon
</div>
Expand Down

0 comments on commit 54c1df1

Please sign in to comment.