Skip to content

Commit 3651f3d

Browse files
committed
Test: Ensure legacy fallback overrides originalToken exists (#34843)
1 parent 470f27a commit 3651f3d

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { legacyFluentVariantsValues } from '../src/fluentLegacyVariants';
2+
import tokens from '../scripts/tokens.json';
3+
import { dedupeShadowTokens } from './dedupeShadowTokens';
4+
5+
const tokensJSON = dedupeShadowTokens(tokens);
6+
7+
describe('Ensure all fluentLegacyVariants fallbacks are valid tokens', () => {
8+
// We'll use this to catch any breaking changes in tokens.json
9+
it('Ensure originalToken in legacy fallback is valid', () => {
10+
Object.keys(legacyFluentVariantsValues).forEach(fluentOverrideKey => {
11+
console.log(`Checking ${fluentOverrideKey}`);
12+
const legacyTokenOverride = legacyFluentVariantsValues[fluentOverrideKey]!;
13+
expect(tokensJSON[legacyTokenOverride.originalToken as keyof typeof tokensJSON]).toBeTruthy();
14+
});
15+
});
16+
});

0 commit comments

Comments
 (0)