Skip to content

Commit

Permalink
fix(pie-tag): DSW-2325 update visual tests
Browse files Browse the repository at this point in the history
  • Loading branch information
raoufswe committed Nov 6, 2024
1 parent c8a34fb commit 67f3502
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/components/pie-tag/test/visual/pie-tag.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,14 @@ const props: PropObject<TagProps & { iconSlot: string }> = {
variant: variants,
size: sizes,
iconPlacement: iconPlacements,
isInteractive: [true, false],
isStrong: [true, false],
disabled: [true, false],
iconSlot: ['', '<icon-heart-filled slot="icon"></icon-heart-filled>'],
};

// Renders a <pie-tag> HTML string with the given prop values
const renderTestPieTag = (propVals: WebComponentPropValues) => `<pie-tag variant="${propVals.variant}" size="${propVals.size}" ${propVals.isStrong ? 'isStrong' : ''} ${propVals.disabled ? 'disabled' : ''}>${propVals.iconSlot} Hello world</pie-tag>`;
const renderTestPieTag = (propVals: WebComponentPropValues) => `<pie-tag variant="${propVals.variant}" size="${propVals.size}" iconPlacement="${propVals.iconPlacement}" ${propVals.isStrong ? 'isStrong' : ''} ${propVals.disabled ? 'disabled' : ''} ${propVals.isInteractive ? 'isInteractive' : ''}>${propVals.iconSlot} Hello world</pie-tag>`;

const componentPropsMatrix = getAllPropCombinations(props);
const componentPropsMatrixByVariant = splitCombinationsByPropertyValue(componentPropsMatrix, 'variant');
Expand All @@ -52,7 +53,9 @@ componentVariants.forEach((variant) => test(`should render all prop variations f
const propKeyValues = `
size: ${testComponent.propValues.size},
variant: ${testComponent.propValues.variant},
iconPlacement: ${testComponent.propValues.iconPlacement},
isStrong: ${testComponent.propValues.isStrong},
isInteractive: ${testComponent.propValues.isInteractive},
disabled: ${testComponent.propValues.disabled},
iconSlot: ${testComponent.propValues.iconSlot ? 'with icon' : 'no icon'}`;
const darkMode = ['neutral-alternative'].includes(variant);
Expand Down

0 comments on commit 67f3502

Please sign in to comment.