Skip to content

Commit

Permalink
test: add specs to confirm classes for each of the sizes
Browse files Browse the repository at this point in the history
  • Loading branch information
ju-Skinner committed Feb 28, 2025
1 parent 80adec9 commit f7dbc6d
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions libs/core/src/components/pds-box/test/pds-box.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -241,17 +241,29 @@ describe('pds-box', () => {
expect(element).toHaveClass('pds-box-offset-xl-2');
});

it('renders padding class when prop is set to sm', async () => {
const page = await newSpecPage({
components: [PdsBox],
html: `<pds-box padding="sm"></pds-box>`,
[ 'xxs', 'xs', 'sm', 'md', 'lg', 'xl', 'xxl' ].forEach((size) => {
it(`renders padding class when prop is set to ${size}`, async () => {
const page = await newSpecPage({
components: [PdsBox],
html: `<pds-box padding="${size}"></pds-box>`,
});

const element = page.root;
expect(element).toHaveClass(`pds-padding-${size}`);
});

const element = page.root;
it(`renders gap class when prop is set to ${size}`, async () => {
const page = await newSpecPage({
components: [PdsBox],
html: `<pds-box gap="${size}"></pds-box>`,
});

expect(element).toHaveClass('pds-padding-sm');
const element = page.root;
expect(element).toHaveClass(`pds-box-gap-${size}`);
});
});


it('renders shadow class when prop is set to xs', async () => {
const page = await newSpecPage({
components: [PdsBox],
Expand Down

0 comments on commit f7dbc6d

Please sign in to comment.