Skip to content

Commit

Permalink
fix: Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
RayRedGoose committed Jul 3, 2024
1 parent 2fc2859 commit ec06e68
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions packages/canvas-tokens-docs/stories/brand/examples/Color.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ const palettes = Object.keys(brand).map(key => {
};
});

brand.alert.accent

export const ColorTokens = () => {
return (
<Stack>
Expand Down
4 changes: 2 additions & 2 deletions packages/canvas-tokens/utils/formatters/formatTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ const recursivelyCreateFileStructure = ({

const innerText = depth
? `${spaces}"${key}": "${values}",`
: `${startingText} ${key}: "${values}";`;
: `${startingText} ${key}: "${values}";\n`;
const fullInnerText = jsDocText + innerText;

updatedContent = replaceInContent(`**${key}**`, fullInnerText);
Expand All @@ -73,7 +73,7 @@ const recursivelyCreateFileStructure = ({
.join('\n');

const innerText = !depth
? `${startingText} ${key}: {\n${placeholders}\n};`
? `${startingText} ${key}: {\n${placeholders}\n};\n`
: `${spaces}"${key}": {\n${placeholders}\n${spaces}},`;

updatedContent = replaceInContent(`**${key}**`, innerText);
Expand Down
4 changes: 2 additions & 2 deletions packages/canvas-tokens/utils/spec/formats.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ describe('formats', () => {

const expected =
headerContent +
'export declare const opacity: {\n /**\n * 0.4\n * \n * Test JSDoc\n */\n "disabled": "--cnvs-base-opacity-300",\n};';
'export declare const opacity: {\n /**\n * 0.4\n * \n * token: base.opacity.400\n * \n * Test JSDoc\n */\n "disabled": "--cnvs-base-opacity-300",\n};\n';

expect(result).toBe(expected);
});
Expand Down Expand Up @@ -402,7 +402,7 @@ describe('formats', () => {

const expected =
headerContent +
'export declare const opacity: {\n /** 0.4 */\n "disabled": "--cnvs-base-opacity-300",\n};';
'export declare const opacity: {\n /** 0.4 */\n "disabled": "--cnvs-base-opacity-300",\n};\n';

expect(result).toBe(expected);
});
Expand Down

0 comments on commit ec06e68

Please sign in to comment.