Skip to content

Commit f883e52

Browse files
mvgalievignatvilesov
authored andcommitted
added UT for capabilities (#17)
1 parent 6e629a3 commit f883e52

2 files changed

Lines changed: 30 additions & 0 deletions

File tree

karma.conf.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,12 @@ module.exports = (config) => {
6262
srcRecursivePath,
6363
'node_modules/jasmine-jquery/lib/jasmine-jquery.js',
6464
'node_modules/powerbi-visuals-utils-testutils/lib/index.js',
65+
{
66+
pattern: './capabilities.json',
67+
watched: false,
68+
served: true,
69+
included: false
70+
},
6571
recursivePathToTests,
6672
{
6773
pattern: srcOriginalRecursivePath,

test/visualTest.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -741,6 +741,30 @@ module powerbi.extensibility.visual.test {
741741
});
742742
});
743743

744+
describe("Capabilities tests", () => {
745+
it("all items having displayName should have displayNameKey property", () => {
746+
jasmine.getJSONFixtures().fixturesPath = "base";
747+
748+
let jsonData = getJSONFixture("capabilities.json");
749+
750+
let objectsChecker: Function = (obj) => {
751+
for (let property in obj) {
752+
let value: any = obj[property];
753+
754+
if (value.displayName) {
755+
expect(value.displayNameKey).toBeDefined();
756+
}
757+
758+
if (typeof value === "object") {
759+
objectsChecker(value);
760+
}
761+
}
762+
};
763+
764+
objectsChecker(jsonData);
765+
});
766+
});
767+
744768
describe("converter", () => {
745769
let colorPalette: IColorPalette,
746770
visualHost: IVisualHost;

0 commit comments

Comments
 (0)