Skip to content

Commit

Permalink
Add tests for language IDs
Browse files Browse the repository at this point in the history
  • Loading branch information
alexesprit committed Sep 15, 2020
1 parent 4cb3a1a commit 5e1cf09
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/items.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const {
iconDefinitions,
fileExtensions,
fileNames,
languageIds,
} = require('./../src/data/items.json');
const colors = require('./../src/data/colors.json');

Expand All @@ -16,6 +17,7 @@ function runTests() {
testThemeItems();

testFileDefinitions();
testLanguageIds();
}

function testIconColors() {
Expand Down Expand Up @@ -65,6 +67,16 @@ function testFileDefinitions() {
}
}

function testLanguageIds() {
for (const languageId in languageIds) {
const itemType = languageIds[languageId];

test(`${languageId} has a valid ${itemType} value`, (t) => {
t.true(itemType in iconDefinitions);
});
}
}

function testIconProp(themeId, propName, condition) {
const iconProps = getIconProps(propName);
for (const entryName in iconProps) {
Expand Down

0 comments on commit 5e1cf09

Please sign in to comment.