From 0efa4674c5dde44aa8dbed5827671842e7b72652 Mon Sep 17 00:00:00 2001 From: robinhoodie0823 Date: Thu, 23 Nov 2023 13:00:49 +0100 Subject: [PATCH] add edge test cases --- package-lock.json | 4 +- src/utils/TokenResolver.test.ts | 66 +++++++++++++++++++++++++++++++++ 2 files changed, 68 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 951bdc0a4..b083bd08c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@tokens-studio/figma-plugin", - "version": "1.38.4", + "version": "1.38.3", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@tokens-studio/figma-plugin", - "version": "1.38.4", + "version": "1.38.3", "license": "MIT", "dependencies": { "@figma-plugin/helpers": "^0.15.2", diff --git a/src/utils/TokenResolver.test.ts b/src/utils/TokenResolver.test.ts index fdbc4bf67..aeb00deb3 100644 --- a/src/utils/TokenResolver.test.ts +++ b/src/utils/TokenResolver.test.ts @@ -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 = [ @@ -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', () => {