Skip to content

Commit

Permalink
added UT for capabilities (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
mvgaliev authored and ignatvilesov committed Nov 1, 2017
1 parent 6e629a3 commit f883e52
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
6 changes: 6 additions & 0 deletions karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@ module.exports = (config) => {
srcRecursivePath,
'node_modules/jasmine-jquery/lib/jasmine-jquery.js',
'node_modules/powerbi-visuals-utils-testutils/lib/index.js',
{
pattern: './capabilities.json',
watched: false,
served: true,
included: false
},
recursivePathToTests,
{
pattern: srcOriginalRecursivePath,
Expand Down
24 changes: 24 additions & 0 deletions test/visualTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -741,6 +741,30 @@ module powerbi.extensibility.visual.test {
});
});

describe("Capabilities tests", () => {
it("all items having displayName should have displayNameKey property", () => {
jasmine.getJSONFixtures().fixturesPath = "base";

let jsonData = getJSONFixture("capabilities.json");

let objectsChecker: Function = (obj) => {
for (let property in obj) {
let value: any = obj[property];

if (value.displayName) {
expect(value.displayNameKey).toBeDefined();
}

if (typeof value === "object") {
objectsChecker(value);
}
}
};

objectsChecker(jsonData);
});
});

describe("converter", () => {
let colorPalette: IColorPalette,
visualHost: IVisualHost;
Expand Down

0 comments on commit f883e52

Please sign in to comment.