Skip to content

Commit

Permalink
add edge test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
robinhoodie0823 committed Nov 23, 2023
1 parent 3ee5a00 commit 0efa467
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 2 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

66 changes: 66 additions & 0 deletions src/utils/TokenResolver.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,36 @@ const tokens = [
value: '{colors.{nestedprimary}.500}',
type: TokenTypes.COLOR,
},
{
name: 'numerictext-1',
value: '003e78',
type: TokenTypes.TEXT,
},
{
name: 'numerictext-2',
value: '000000',
type: TokenTypes.TEXT,
},
{
name: 'numerictext-3',
value: '001000',
type: TokenTypes.TEXT,
},
{
name: 'numerictext-4',
value: '06e455',
type: TokenTypes.TEXT,
},
{
name: 'numerictext-5',
value: '013456',
type: TokenTypes.TEXT,
},
{
name: 'numerictext-6',
value: '000001',
type: TokenTypes.TEXT,
},
];

const output = [
Expand Down Expand Up @@ -523,6 +553,42 @@ const output = [
rawValue: '{colors.{nestedprimary}.500}',
type: TokenTypes.COLOR,
},
{
name: 'numerictext-1',
value: '003e78',
rawValue: '003e78',
type: TokenTypes.TEXT,
},
{
name: 'numerictext-2',
value: '000000',
rawValue: '000000',
type: TokenTypes.TEXT,
},
{
name: 'numerictext-3',
value: '001000',
rawValue: '001000',
type: TokenTypes.TEXT,
},
{
name: 'numerictext-4',
value: '06e455',
rawValue: '06e455',
type: TokenTypes.TEXT,
},
{
name: 'numerictext-5',
value: '013456',
rawValue: '013456',
type: TokenTypes.TEXT,
},
{
name: 'numerictext-6',
value: '000001',
rawValue: '000001',
type: TokenTypes.TEXT,
},
];
describe('resolveTokenValues deep nested', () => {
it('resolves all values it can resolve', () => {
Expand Down

0 comments on commit 0efa467

Please sign in to comment.