Skip to content

Commit

Permalink
feat: updated test
Browse files Browse the repository at this point in the history
  • Loading branch information
pedroportella committed Dec 12, 2024
1 parent d2985d0 commit 83a5d91
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/qgds.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ const cssOutputFilePath = path.resolve(cssOutputDir, cssOutputFileName);
const tokenTestObject = {
"qgds": {
"color": {"json": `color`, "css": `--qgds-color`},
"fontSizeMap": {"json": `fontSizeMap`, "css": `--qgds-font-size-map`},
"mediaQuery": {"json": `mediaQuery`, "css": `--qgds-media-query`}
},
"typography": {
"phone": {
Expand Down Expand Up @@ -53,6 +55,8 @@ describe('qgds tests', () => {
const file = await promises.readFile(jsonQGDSOutputFilePath, 'utf-8');
expect(file).toContain(`qgds`);
expect(file).toContain(tokenTestObject.qgds.color.json);
expect(file).toContain(tokenTestObject.qgds.fontSizeMap.json);
expect(file).toContain(tokenTestObject.qgds.mediaQuery.json);
});

it('sanity - contains at least one: typography in JSON file', async () => {
Expand Down Expand Up @@ -82,6 +86,8 @@ describe('qgds tests', () => {
const file = await promises.readFile(cssOutputFilePath, 'utf-8');
// qgds tokens
expect(file).toContain(tokenTestObject.qgds.color.css);
expect(file).toContain(tokenTestObject.qgds.fontSizeMap.css);
expect(file).toContain(tokenTestObject.qgds.mediaQuery.css);
// typography tokens
expect(file).toContain(tokenTestObject.typography.phone.h1.json);
expect(file).toContain(tokenTestObject.typography.phone.h2.json);
Expand Down

0 comments on commit 83a5d91

Please sign in to comment.