Skip to content

Commit

Permalink
test(pci-common): update region-selector test suites
Browse files Browse the repository at this point in the history
ref: TAPC-2378
Signed-off-by: Frédéric Vilcot <[email protected]>
  • Loading branch information
fredericvilcot committed Dec 13, 2024
1 parent 84ded78 commit 70fc14b
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
import { render, screen } from '@testing-library/react';
import { render } from '@testing-library/react';
import { RegionGlobalzoneChip } from './RegionGlobalzoneChip.component';
import { wrapper } from '@/wrapperRenders';

describe('RegionGlobalzoneChip', () => {
it('renders chip with correct text', () => {
render(<RegionGlobalzoneChip />, { wrapper });
expect(
screen.getByText('pci_project_flavors_zone_global_region'),
).toBeInTheDocument();
it('renders tag with correct text', () => {
const { container } = render(<RegionGlobalzoneChip />, { wrapper });
const tagElt = container.querySelector('#popover-trigger').firstChild;

expect(tagElt).toBeInTheDocument();
expect(tagElt).toHaveAttribute(
'label',
'pci_project_flavors_zone_global_region',
);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,14 @@ import { RegionLocalzoneChip } from './RegionLocalzoneChip.component';
import { wrapper } from '@/wrapperRenders';

describe('RegionLocalzoneChip', () => {
it('renders chip with correct text', () => {
render(<RegionLocalzoneChip />, { wrapper });
expect(
screen.getByText('pci_project_flavors_zone_localzone'),
).toBeInTheDocument();
it('renders tag with correct text', () => {
const { container } = render(<RegionLocalzoneChip />, { wrapper });
const tagElt = container.querySelector('#popover-trigger').firstChild;

expect(tagElt).toBeInTheDocument();
expect(tagElt).toHaveAttribute(
'label',
'pci_project_flavors_zone_localzone',
);
});
});

0 comments on commit 70fc14b

Please sign in to comment.