Skip to content

Commit

Permalink
fix tokens test
Browse files Browse the repository at this point in the history
  • Loading branch information
rachelbt committed Dec 18, 2024
1 parent 5da1fec commit cdb8dbe
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions libs/tokens/src/lib/transforms/shadow-shorthand.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,13 @@ describe('basic', () => {

it('should match if category and type comply to a shadow type', () => {
expect(matcher({ ...defaultToken, attributes: {} })).toEqual(false);
expect(
matcher({
...defaultToken,
type: 'boxShadow',
attributes: { category: 'something-with-shadow' },
})
).toEqual(true);
expect(matcher(token)).toEqual(true);
});
});
2 changes: 1 addition & 1 deletion libs/tokens/src/lib/transforms/shadow-shorthand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export default {
name: 'shadow/shorthand',
transitive: true,
matcher: ({ type, attributes: { category } }) =>
category?.includes('shadow') && type == 'boxShadow',
!!category?.includes('shadow') && type == 'boxShadow',
transformer: ({ value }) =>
Array.isArray(value) ? parseShadowEffects(value) : value,
} as Named<Transform>;

0 comments on commit cdb8dbe

Please sign in to comment.