diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 61e5e43..6bb2bdc 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -8,6 +8,10 @@ on: jobs: CodeQL-Build: + permissions: + contents: read + actions: read + security-events: write runs-on: ubuntu-latest @@ -26,7 +30,7 @@ jobs: # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@v1 + uses: github/codeql-action/init@v2 # Override language selection by uncommenting this and choosing your languages # with: # languages: go, javascript, csharp, python, cpp, java @@ -34,7 +38,7 @@ jobs: # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). # If this step fails, then you should remove it and run the build manually (see below) - name: Autobuild - uses: github/codeql-action/autobuild@v1 + uses: github/codeql-action/autobuild@v2 # ℹī¸ Command-line programs to run using the OS shell. # 📚 https://git.io/JvXDl @@ -48,4 +52,4 @@ jobs: # make release - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v1 + uses: github/codeql-action/analyze@v2 diff --git a/CHANGELOG.md b/CHANGELOG.md index 9908176..3d43879 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## 6.1.0 +* Now `createVisualHost` method has only **one parameter** with interface `CreateVisualHostOptions` (includes all previous parameters) +* Added mock service for `IVisualLocalStorageV2Service` +* Added mock service for `IVisualSubSelectionService` + ## 6.0.2 * Added missing mock functions diff --git a/package-lock.json b/package-lock.json index 91cd8bd..f1f94c4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,37 +1,37 @@ { "name": "powerbi-visuals-utils-testutils", - "version": "6.0.3", + "version": "6.1.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "powerbi-visuals-utils-testutils", - "version": "6.0.3", + "version": "6.1.0", "license": "MIT", "dependencies": { "d3-array": "3.2.4", "d3-timer": "3.0.1", "lodash-es": "4.17.21", - "powerbi-visuals-api": "^5.7.0", + "powerbi-visuals-api": "^5.8.0", "powerbi-visuals-utils-formattingmodel": "^6.0.1", "powerbi-visuals-utils-typeutils": "^6.0.2" }, "devDependencies": { - "@snyk/protect": "^1.1269.0", + "@snyk/protect": "^1.1280.1", "@types/d3-timer": "3.0.2", "@types/jasmine": "5.1.4", "@types/jquery": "^3.5.29", "@types/karma": "^6.3.8", - "@types/node": "^20.11.0", + "@types/node": "^20.11.20", "@types/webpack": "5.28.5", - "@typescript-eslint/eslint-plugin": "^5.57.0", - "@typescript-eslint/parser": "^5.57.0", + "@typescript-eslint/eslint-plugin": "^5.62.0", + "@typescript-eslint/parser": "^5.62.0", "chalk": "5.3.0", "coverage-istanbul-loader": "^3.0.5", - "eslint": "^8.37.0", + "eslint": "^8.57.0", "eslint-plugin-powerbi-visuals": "^0.8.1", "jasmine": "5.1.0", - "karma": "^6.4.2", + "karma": "^6.4.3", "karma-chrome-launcher": "3.2.0", "karma-coverage": "2.2.1", "karma-coverage-istanbul-reporter": "3.0.3", @@ -39,12 +39,12 @@ "karma-sourcemap-loader": "0.4.0", "karma-typescript": "5.5.4", "karma-typescript-preprocessor": "0.4.0", - "karma-webpack": "5.0.0", - "playwright-chromium": "^1.40.1", + "karma-webpack": "5.0.1", + "playwright-chromium": "^1.41.2", "ts-loader": "9.5.1", "ts-node": "^10.9.2", "typescript": "^4.9.5", - "webpack": "5.89.0", + "webpack": "5.90.3", "webpack-node-externals": "^3.0.0" }, "optionalDependencies": { @@ -564,22 +564,22 @@ } }, "node_modules/@eslint/js": { - "version": "8.56.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.56.0.tgz", - "integrity": "sha512-gMsVel9D7f2HLkBma9VbtzZRehRogVRfbr++f06nL2vnCGCNlzOD+/MUov/F4p8myyAHspEhVobgjpX64q5m6A==", + "version": "8.57.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.57.0.tgz", + "integrity": "sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g==", "dev": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } }, "node_modules/@humanwhocodes/config-array": { - "version": "0.11.13", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.13.tgz", - "integrity": "sha512-JSBDMiDKSzQVngfRjOdFXgFfklaXI4K9nLF49Auh21lmBWRLIK3+xTErTWD4KU54pb6coM6ESE7Awz/FNU3zgQ==", + "version": "0.11.14", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.14.tgz", + "integrity": "sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg==", "dev": true, "dependencies": { - "@humanwhocodes/object-schema": "^2.0.1", - "debug": "^4.1.1", + "@humanwhocodes/object-schema": "^2.0.2", + "debug": "^4.3.1", "minimatch": "^3.0.5" }, "engines": { @@ -600,9 +600,9 @@ } }, "node_modules/@humanwhocodes/object-schema": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.1.tgz", - "integrity": "sha512-dvuCeX5fC9dXgJn9t+X5atfmgQAzUOWqS1254Gh0m6i8wKd10ebXkfNKiRK+1GWi/yTvvLDHpoxLr0xxxeslWw==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.2.tgz", + "integrity": "sha512-6EwiSjwWYP7pTckG6I5eyFANjPhmPjUX9JRLUSfNPC7FX7zK9gyZAfUEaECL6ALTpGX5AjnBq3C9XmVWPitNpw==", "dev": true }, "node_modules/@isaacs/cliui": { @@ -793,9 +793,9 @@ } }, "node_modules/@snyk/protect": { - "version": "1.1269.0", - "resolved": "https://registry.npmjs.org/@snyk/protect/-/protect-1.1269.0.tgz", - "integrity": "sha512-2sBAjL8NC4+N6AJU06cpAR+6Uu0pTB7K4Cho7W0kF6K0dfXrikJ1EFQ/Q5OOlJZCW+oUuuf9xFr4bSreLXU4Wg==", + "version": "1.1280.1", + "resolved": "https://registry.npmjs.org/@snyk/protect/-/protect-1.1280.1.tgz", + "integrity": "sha512-4PyEQMRVqwLYZlfqhfztbMAyBl7M6Wj89XsySSjSdzUEYSr0ZTYOFQo8OUTf0xmfdPU56xnIGeIOv9qgSgZbBg==", "dev": true, "bin": { "snyk-protect": "bin/snyk-protect" @@ -913,9 +913,9 @@ } }, "node_modules/@types/node": { - "version": "20.11.0", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.0.tgz", - "integrity": "sha512-o9bjXmDNcF7GbM4CNQpmi+TutCgap/K3w1JyKgxAjqx41zp9qlIAVFi0IhCNsJcXolEqLWhbFbEeL0PvYm4pcQ==", + "version": "20.11.20", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.20.tgz", + "integrity": "sha512-7/rR21OS+fq8IyHTgtLkDK949uzsa6n8BkziAKtPVpugIkO6D+/ooXMvzXxDnZrmtXVfjb1bKQafYpb8s89LOg==", "dev": true, "dependencies": { "undici-types": "~5.26.4" @@ -2544,16 +2544,16 @@ } }, "node_modules/eslint": { - "version": "8.56.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.56.0.tgz", - "integrity": "sha512-Go19xM6T9puCOWntie1/P997aXxFsOi37JIHRWI514Hc6ZnaHGKY9xFhrU65RT6CcBEzZoGG1e6Nq+DT04ZtZQ==", + "version": "8.57.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.57.0.tgz", + "integrity": "sha512-dZ6+mexnaTIbSBZWgou51U6OmzIhYM2VcNdtiTtI7qPNZm35Akpr0f6vtw3w1Kmn5PYo+tZVfh13WrhpS6oLqQ==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.6.1", "@eslint/eslintrc": "^2.1.4", - "@eslint/js": "8.56.0", - "@humanwhocodes/config-array": "^0.11.13", + "@eslint/js": "8.57.0", + "@humanwhocodes/config-array": "^0.11.14", "@humanwhocodes/module-importer": "^1.0.1", "@nodelib/fs.walk": "^1.2.8", "@ungap/structured-clone": "^1.2.0", @@ -3916,9 +3916,9 @@ } }, "node_modules/karma": { - "version": "6.4.2", - "resolved": "https://registry.npmjs.org/karma/-/karma-6.4.2.tgz", - "integrity": "sha512-C6SU/53LB31BEgRg+omznBEMY4SjHU3ricV6zBcAe1EeILKkeScr+fZXtaI5WyDbkVowJxxAI6h73NcFPmXolQ==", + "version": "6.4.3", + "resolved": "https://registry.npmjs.org/karma/-/karma-6.4.3.tgz", + "integrity": "sha512-LuucC/RE92tJ8mlCwqEoRWXP38UMAqpnq98vktmS9SznSoUPPUJQbc91dHcxcunROvfQjdORVA/YFviH+Xci9Q==", "dev": true, "dependencies": { "@colors/colors": "1.5.0", @@ -3940,7 +3940,7 @@ "qjobs": "^1.2.0", "range-parser": "^1.2.1", "rimraf": "^3.0.2", - "socket.io": "^4.4.1", + "socket.io": "^4.7.2", "source-map": "^0.6.1", "tmp": "^0.2.1", "ua-parser-js": "^0.7.30", @@ -4208,22 +4208,46 @@ } }, "node_modules/karma-webpack": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/karma-webpack/-/karma-webpack-5.0.0.tgz", - "integrity": "sha512-+54i/cd3/piZuP3dr54+NcFeKOPnys5QeM1IY+0SPASwrtHsliXUiCL50iW+K9WWA7RvamC4macvvQ86l3KtaA==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/karma-webpack/-/karma-webpack-5.0.1.tgz", + "integrity": "sha512-oo38O+P3W2mSPCSUrQdySSPv1LvPpXP+f+bBimNomS5sW+1V4SuhCuW8TfJzV+rDv921w2fDSDw0xJbPe6U+kQ==", "dev": true, "dependencies": { "glob": "^7.1.3", - "minimatch": "^3.0.4", + "minimatch": "^9.0.3", "webpack-merge": "^4.1.5" }, "engines": { - "node": ">= 6" + "node": ">= 18" }, "peerDependencies": { "webpack": "^5.0.0" } }, + "node_modules/karma-webpack/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/karma-webpack/node_modules/minimatch": { + "version": "9.0.3", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", + "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", + "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/keyv": { "version": "4.5.4", "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", @@ -4870,13 +4894,13 @@ } }, "node_modules/playwright-chromium": { - "version": "1.40.1", - "resolved": "https://registry.npmjs.org/playwright-chromium/-/playwright-chromium-1.40.1.tgz", - "integrity": "sha512-3atylP47OCTBW0siGI7LOEG/XKL/vnrFH8xdr4uaTnqMsc0Xq4gOLk2gGwniPJ76LSc++9ASc0w/nfqtLAmm3A==", + "version": "1.41.2", + "resolved": "https://registry.npmjs.org/playwright-chromium/-/playwright-chromium-1.41.2.tgz", + "integrity": "sha512-1XoW4aGGRbS2BJLldtLcv2QW3deMv8myE5iCtfGRPq99BWqmBLJvJTgY/SyfBCoklwQvl91zUWYWHjCAuvKGkw==", "dev": true, "hasInstallScript": true, "dependencies": { - "playwright-core": "1.40.1" + "playwright-core": "1.41.2" }, "bin": { "playwright": "cli.js" @@ -4886,9 +4910,9 @@ } }, "node_modules/playwright-core": { - "version": "1.40.1", - "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.40.1.tgz", - "integrity": "sha512-+hkOycxPiV534c4HhpfX6yrlawqVUzITRKwHAmYfmsVreltEl6fAZJ3DPfLMOODw0H3s1Itd6MDCWmP1fl/QvQ==", + "version": "1.41.2", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.41.2.tgz", + "integrity": "sha512-VaTvwCA4Y8kxEe+kfm2+uUUw5Lubf38RxF7FpBxLPmGe5sdNkSg5e3ChEigaGrX7qdqT3pt2m/98LiyvU2x6CA==", "dev": true, "bin": { "playwright-core": "cli.js" @@ -4898,9 +4922,9 @@ } }, "node_modules/powerbi-visuals-api": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/powerbi-visuals-api/-/powerbi-visuals-api-5.7.0.tgz", - "integrity": "sha512-sPAGYUUkTtbbZXyL8cIJZh6MrZ7BiXPs5li3V7pAa3UUQC3Jih7OS1Hq9AsTp05IKsp94YHXILrcyn4mNAi9qg==", + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/powerbi-visuals-api/-/powerbi-visuals-api-5.8.0.tgz", + "integrity": "sha512-0rcldFiNPn0HSQ3XGdFzRqFofh/UHn0zcGMtcUWXqJIIL3ekhpdRmTdw/OsT9biEHVnBiim3HIhgHHoGr/se/Q==", "dependencies": { "semver": "^7.3.5" } @@ -4913,6 +4937,14 @@ "powerbi-visuals-api": "~5.7.0" } }, + "node_modules/powerbi-visuals-utils-formattingmodel/node_modules/powerbi-visuals-api": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/powerbi-visuals-api/-/powerbi-visuals-api-5.7.0.tgz", + "integrity": "sha512-sPAGYUUkTtbbZXyL8cIJZh6MrZ7BiXPs5li3V7pAa3UUQC3Jih7OS1Hq9AsTp05IKsp94YHXILrcyn4mNAi9qg==", + "dependencies": { + "semver": "^7.3.5" + } + }, "node_modules/powerbi-visuals-utils-typeutils": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/powerbi-visuals-utils-typeutils/-/powerbi-visuals-utils-typeutils-6.0.2.tgz", @@ -6123,19 +6155,19 @@ } }, "node_modules/webpack": { - "version": "5.89.0", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.89.0.tgz", - "integrity": "sha512-qyfIC10pOr70V+jkmud8tMfajraGCZMBWJtrmuBymQKCrLTRejBI8STDp1MCyZu/QTdZSeacCQYpYNQVOzX5kw==", + "version": "5.90.3", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.90.3.tgz", + "integrity": "sha512-h6uDYlWCctQRuXBs1oYpVe6sFcWedl0dpcVaTf/YF67J9bKvwJajFulMVSYKHrksMB3I/pIagRzDxwxkebuzKA==", "dev": true, "dependencies": { "@types/eslint-scope": "^3.7.3", - "@types/estree": "^1.0.0", + "@types/estree": "^1.0.5", "@webassemblyjs/ast": "^1.11.5", "@webassemblyjs/wasm-edit": "^1.11.5", "@webassemblyjs/wasm-parser": "^1.11.5", "acorn": "^8.7.1", "acorn-import-assertions": "^1.9.0", - "browserslist": "^4.14.5", + "browserslist": "^4.21.10", "chrome-trace-event": "^1.0.2", "enhanced-resolve": "^5.15.0", "es-module-lexer": "^1.2.1", @@ -6149,7 +6181,7 @@ "neo-async": "^2.6.2", "schema-utils": "^3.2.0", "tapable": "^2.1.1", - "terser-webpack-plugin": "^5.3.7", + "terser-webpack-plugin": "^5.3.10", "watchpack": "^2.4.0", "webpack-sources": "^3.2.3" }, diff --git a/package.json b/package.json index d5e8455..1181c56 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "powerbi-visuals-utils-testutils", - "version": "6.0.3", + "version": "6.1.0", "description": "powerbi-visuals-utils-testutils", "main": "lib/index.js", "module": "lib/index.js", @@ -36,17 +36,17 @@ "@types/jasmine": "5.1.4", "@types/jquery": "^3.5.29", "@types/karma": "^6.3.8", - "@types/node": "^20.11.0", + "@types/node": "^20.11.20", "@types/webpack": "5.28.5", - "@typescript-eslint/eslint-plugin": "^5.57.0", - "@typescript-eslint/parser": "^5.57.0", - "@snyk/protect": "^1.1269.0", + "@typescript-eslint/eslint-plugin": "^5.62.0", + "@typescript-eslint/parser": "^5.62.0", + "@snyk/protect": "^1.1280.1", "chalk": "5.3.0", "coverage-istanbul-loader": "^3.0.5", - "eslint": "^8.37.0", + "eslint": "^8.57.0", "eslint-plugin-powerbi-visuals": "^0.8.1", "jasmine": "5.1.0", - "karma": "^6.4.2", + "karma": "^6.4.3", "karma-chrome-launcher": "3.2.0", "karma-coverage": "2.2.1", "karma-coverage-istanbul-reporter": "3.0.3", @@ -54,19 +54,19 @@ "karma-sourcemap-loader": "0.4.0", "karma-typescript": "5.5.4", "karma-typescript-preprocessor": "0.4.0", - "karma-webpack": "5.0.0", - "playwright-chromium": "^1.40.1", + "karma-webpack": "5.0.1", + "playwright-chromium": "^1.41.2", "ts-loader": "9.5.1", "ts-node": "^10.9.2", "typescript": "^4.9.5", - "webpack": "5.89.0", + "webpack": "5.90.3", "webpack-node-externals": "^3.0.0" }, "dependencies": { "d3-array": "3.2.4", "d3-timer": "3.0.1", "lodash-es": "4.17.21", - "powerbi-visuals-api": "^5.7.0", + "powerbi-visuals-api": "^5.8.0", "powerbi-visuals-utils-formattingmodel": "^6.0.1", "powerbi-visuals-utils-typeutils": "^6.0.2" }, diff --git a/src/VisualBuilderBase.ts b/src/VisualBuilderBase.ts index af8db95..9f49df9 100644 --- a/src/VisualBuilderBase.ts +++ b/src/VisualBuilderBase.ts @@ -58,7 +58,7 @@ export abstract class VisualBuilderBase { this.element.classList.add(`visual-${guid}`); } - this.visualHost = createVisualHost(); + this.visualHost = createVisualHost({}); this.viewport = { height: height, diff --git a/src/index.ts b/src/index.ts index dd02b51..3f3f361 100644 --- a/src/index.ts +++ b/src/index.ts @@ -8,7 +8,15 @@ import { MockILocalizationManager } from "./mocks/mockILocalizationManager"; import { MockISelectionId } from "./mocks/mockISelectionId"; import { MockIColorPalette } from "./mocks/mockIColorPalette"; import { MockIVisualHost } from "./mocks/mockVisualHost"; +import { MockIEventService } from "./mocks/mockIEventService"; +import { MockIStorageService } from "./mocks/mockIStorageService"; +import { MockIStorageV2Service } from "./mocks/mockIStorageV2Service"; import { MockHostCapabilities } from "./mocks/mockHostCapabilities"; +import { MockDownloadService } from "./mocks/mockDownloadService"; +import { MockIVisualLicenseManager } from "./mocks/mockIVisualLicenseManager"; +import { MockIWebAccessService } from "./mocks/mockIWebAccessService"; +import { MockIAcquireAADTokenService } from "./mocks/mockIAcquireAADTokenService"; +import { MockSubSelectionService } from "./mocks/mockSubSelectionService"; import { testDom, @@ -63,6 +71,7 @@ import { createSelectionManager, createTooltipService, createHostCapabilities, + CreateVisualHostOptions } from "./mocks/mocks"; import { setGrouped, createValueColumns, createCategoricalDataViewBuilder } from "./dataViewBuilder/dataViewBuilder"; import { MatrixDataViewBuilder} from "./dataViewBuilder/matrixBuilder"; @@ -90,6 +99,7 @@ export { createSelectionManager, createTooltipService, createHostCapabilities, + CreateVisualHostOptions, setGrouped, createValueColumns, createCategoricalDataViewBuilder, @@ -107,7 +117,15 @@ export { MockISelectionId, MockIColorPalette, MockIVisualHost, + MockIEventService, + MockIStorageService, + MockIStorageV2Service, MockHostCapabilities, + MockDownloadService, + MockIVisualLicenseManager, + MockIWebAccessService, + MockIAcquireAADTokenService, + MockSubSelectionService, renderTimeout, assertColorsMatch, getSolidColorStructuralObject, diff --git a/src/mocks/mockIColorPalette.ts b/src/mocks/mockIColorPalette.ts index d297d26..8f65580 100644 --- a/src/mocks/mockIColorPalette.ts +++ b/src/mocks/mockIColorPalette.ts @@ -106,32 +106,32 @@ export class MockIColorPalette implements IColorPalette { return color; } - isHighContrast: true; - foreground: {value: "#333333" }; - foregroundLight: {value: "#FFF" }; - foregroundDark: {value: "#000" }; - foregroundNeutralLight: {value: "#EAEAEA" }; - foregroundNeutralDark: {value: "#212121" }; - foregroundNeutralSecondary: {value: "#666666" }; - foregroundNeutralSecondaryAlt: {value: "#777777" }; - foregroundNeutralSecondaryAlt2: {value: "#888888" }; - foregroundNeutralTertiary: {value: "#A6A6A6" }; - foregroundNeutralTertiaryAlt: {value: "#C8C8C8" }; - foregroundSelected: {value: "#333333" }; - foregroundButton: {value: "#666666" }; - background: {value: "#FFF" }; - backgroundLight: {value: "#EAEAEA" }; - backgroundNeutral: {value: "#C8C8C8" }; - backgroundDark: {value: "#000" }; - hyperlink: {value: "#1F3A93" }; - visitedHyperlink: {value: "#551A8B" }; - mapPushpin: {value: "#FF5F00" }; - shapeStroke: {value: "#01B8AA" }; - selection: {value: undefined }; - separator: {value: undefined }; - negative: {value: undefined }; - neutral: {value: undefined }; - positive: {value: undefined }; + public isHighContrast: true; + public foreground = {value: "#333333" }; + public foregroundLight = {value: "#FFF" }; + public foregroundDark = {value: "#000" }; + public foregroundNeutralLight = {value: "#EAEAEA" }; + public foregroundNeutralDark = {value: "#212121" }; + public foregroundNeutralSecondary = {value: "#666666" }; + public foregroundNeutralSecondaryAlt = {value: "#777777" }; + public foregroundNeutralSecondaryAlt2 = {value: "#888888" }; + public foregroundNeutralTertiary = {value: "#A6A6A6" }; + public foregroundNeutralTertiaryAlt = {value: "#C8C8C8" }; + public foregroundSelected = {value: "#333333" }; + public foregroundButton = {value: "#666666" }; + public background = {value: "#FFF" }; + public backgroundLight = {value: "#EAEAEA" }; + public backgroundNeutral = {value: "#C8C8C8" }; + public backgroundDark = {value: "#000" }; + public hyperlink = {value: "#1F3A93" }; + public visitedHyperlink = {value: "#551A8B" }; + public mapPushpin = {value: "#FF5F00" }; + public shapeStroke = {value: "#01B8AA" }; + public selection = {value: undefined }; + public separator = {value: undefined }; + public negative = {value: undefined }; + public neutral = {value: undefined }; + public positive = {value: undefined }; public reset(): IColorPalette { return this; diff --git a/src/mocks/mockIStorageService.ts b/src/mocks/mockIStorageService.ts index 225e31b..9974b6b 100644 --- a/src/mocks/mockIStorageService.ts +++ b/src/mocks/mockIStorageService.ts @@ -28,13 +28,7 @@ import powerbi from "powerbi-visuals-api"; import IPromise = powerbi.IPromise; import PrivilegeStatus = powerbi.PrivilegeStatus; - -export interface ILocalVisualStorageService { - status(): IPromise - get(key: string): IPromise; - set(key: string, data: string): IPromise; - remove(key: string): void; -} +import ILocalVisualStorageService = powerbi.extensibility.ILocalVisualStorageService function getLocalStorageStatus() { try { diff --git a/src/mocks/mockIStorageV2Service.ts b/src/mocks/mockIStorageV2Service.ts new file mode 100644 index 0000000..4416521 --- /dev/null +++ b/src/mocks/mockIStorageV2Service.ts @@ -0,0 +1,72 @@ +/* + * Power BI Visualizations + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the ""Software""), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +// powerbi +import powerbi from "powerbi-visuals-api"; +import IPromise = powerbi.IPromise; +import PrivilegeStatus = powerbi.PrivilegeStatus; +import IVisualLocalStorageV2Service = powerbi.extensibility.IVisualLocalStorageV2Service +import StorageV2ResultInfo = powerbi.extensibility.StorageV2ResultInfo + +function getLocalStorageStatus() { + try { + return PrivilegeStatus.Allowed; + } + catch (e) { + return PrivilegeStatus.NotDeclared; + } +} + +export class MockIStorageV2Service implements IVisualLocalStorageV2Service { + + public status(): IPromise { + const status: PrivilegeStatus = getLocalStorageStatus(); + + return new Promise((resolve, reject) => { + resolve(status); + }) as any; + } + + public get(key: string): IPromise { + const data: string | null = localStorage.getItem(key); + + return new Promise((resolve, reject) => { + resolve(data); + }) as any; + } + + public set(key: string, data: string): IPromise { + localStorage.setItem(key, data); + + return new Promise((resolve, reject) => { + resolve({ success: true }); + }) as any; + } + + public remove(key: string): void { + localStorage.removeItem(key); + } +} \ No newline at end of file diff --git a/src/mocks/mockSubSelectionService.ts b/src/mocks/mockSubSelectionService.ts new file mode 100644 index 0000000..176eb27 --- /dev/null +++ b/src/mocks/mockSubSelectionService.ts @@ -0,0 +1,38 @@ +/* + * Power BI Visualizations + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the ""Software""), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +/* eslint-disable @typescript-eslint/no-empty-function */ + +import powerbi from "powerbi-visuals-api"; +import IVisualSubSelectionService = powerbi.extensibility.IVisualSubSelectionService +import CustomVisualSubSelection = powerbi.visuals.CustomVisualSubSelection +import SubSelectionRegionOutline = powerbi.visuals.SubSelectionRegionOutline + +export class MockSubSelectionService implements IVisualSubSelectionService { + + public subSelect(subSelection: CustomVisualSubSelection): void {} + + public updateRegionOutlines(outlines: SubSelectionRegionOutline[]): void {} +} \ No newline at end of file diff --git a/src/mocks/mockVisualHost.ts b/src/mocks/mockVisualHost.ts index 39e5de5..44f4ddf 100644 --- a/src/mocks/mockVisualHost.ts +++ b/src/mocks/mockVisualHost.ts @@ -28,7 +28,6 @@ import powerbi from "powerbi-visuals-api"; import ITooltipService = powerbi.extensibility.ITooltipService; -import { ILocalVisualStorageService } from "./mockIStorageService"; import { createSelectionIdBuilder } from "./mocks"; import { MockILocale } from "./mockILocale"; // powerbi @@ -46,6 +45,9 @@ import IDownloadService = powerbi.extensibility.IDownloadService; import HostCapabilities = powerbi.extensibility.HostCapabilities; import IVisualLicenseManager = powerbi.extensibility.IVisualLicenseManager; import IWebAccessService = powerbi.extensibility.IWebAccessService; +import ILocalVisualStorageService = powerbi.extensibility.ILocalVisualStorageService; +import IVisualLocalStorageV2Service = powerbi.extensibility.IVisualLocalStorageV2Service; +import IVisualSubSelectionService = powerbi.extensibility.IVisualSubSelectionService; // powerbi.extensibility.visual import IVisualHost = powerbi.extensibility.visual.IVisualHost; @@ -54,6 +56,26 @@ import DialogOpenOptions = powerbi.extensibility.visual.DialogOpenOptions import CustomVisualApplyCustomSortArgs = powerbi.extensibility.visual.CustomVisualApplyCustomSortArgs; import IAcquireAADTokenService = powerbi.extensibility.IAcquireAADTokenService; +export interface IMockVisualHostOptions { + colorPalette?: IColorPalette, + selectionManager?: ISelectionManager, + tooltipServiceInstance?: ITooltipService, + localeInstance?: MockILocale, + localizationManager?: powerbi.extensibility.ILocalizationManager, + telemetryService?: powerbi.extensibility.ITelemetryService, + authService?: powerbi.extensibility.IAuthenticationService, + storageService?: ILocalVisualStorageService, + eventService?: IVisualEventService, + hostCapabilities?: HostCapabilities, + downloadService?: IDownloadService, + licenseManager?: IVisualLicenseManager, + webAccessService?: IWebAccessService, + acquireAADTokenService?: IAcquireAADTokenService, + modalDialogResult?: powerbi.extensibility.visual.ModalDialogResult, + storageV2Service?: IVisualLocalStorageV2Service, + subSelectionService?: IVisualSubSelectionService +} + export class MockIVisualHost implements IVisualHost { private colorPaletteInstance: IColorPalette; private selectionManager: ISelectionManager; @@ -70,28 +92,33 @@ export class MockIVisualHost implements IVisualHost { public webAccessService: IWebAccessService; public acquireAADTokenService: IAcquireAADTokenService; public modalDialogResult: ModalDialogResult; + public storageV2Service: IVisualLocalStorageV2Service; + public subSelectionService: IVisualSubSelectionService; public hostEnv: powerbi.common.CustomVisualHostEnv = 1; - constructor( - colorPalette?: IColorPalette, - selectionManager?: ISelectionManager, - tooltipServiceInstance?: ITooltipService, - localeInstance?: MockILocale, - localizationManager?: powerbi.extensibility.ILocalizationManager, - telemetryService?: powerbi.extensibility.ITelemetryService, - authService?: powerbi.extensibility.IAuthenticationService, - storageService?: ILocalVisualStorageService, - eventService?: IVisualEventService, - hostCapabilities?: HostCapabilities, - downloadService?: IDownloadService, - licenseManager?: IVisualLicenseManager, - webAccessService?: IWebAccessService, - acquireAADTokenService?: IAcquireAADTokenService, - modalDialogResult?: powerbi.extensibility.visual.ModalDialogResult - ) { + constructor({ + colorPalette, + selectionManager, + subSelectionService, + tooltipServiceInstance, + localeInstance, + localizationManager, + telemetryService, + authService, + storageService, + storageV2Service, + eventService, + hostCapabilities, + downloadService, + licenseManager, + webAccessService, + acquireAADTokenService, + modalDialogResult, + }: IMockVisualHostOptions) { this.colorPaletteInstance = colorPalette; this.selectionManager = selectionManager; + this.subSelectionService = subSelectionService; this.tooltipServiceInstance = tooltipServiceInstance; this.localeInstance = localeInstance; this.telemetryService = telemetryService; @@ -99,6 +126,7 @@ export class MockIVisualHost implements IVisualHost { this.localizationManager = localizationManager; this.localStorageService = storageService; this.visualEventService = eventService; + this.storageV2Service = storageV2Service; this.hostCapabilities = hostCapabilities; this.downloadService = downloadService; this.licenseManager = licenseManager; diff --git a/src/mocks/mocks.ts b/src/mocks/mocks.ts index 50dc064..78b225b 100644 --- a/src/mocks/mocks.ts +++ b/src/mocks/mocks.ts @@ -24,8 +24,28 @@ * THE SOFTWARE. */ import powerbi from "powerbi-visuals-api"; +// powerbi +import IColorInfo = powerbi.IColorInfo; + +// powerbi.visuals +import ISelectionIdBuilder = powerbi.visuals.ISelectionIdBuilder; +import ISelectionId = powerbi.visuals.ISelectionId; + +// powerbi.extensibility +import IDownloadService = powerbi.extensibility.IDownloadService; +import IColorPalette = powerbi.extensibility.ISandboxExtendedColorPalette; +import ISelectionManager = powerbi.extensibility.ISelectionManager; import ITooltipService = powerbi.extensibility.ITooltipService; +import IVisualHost = powerbi.extensibility.visual.IVisualHost; import IVisualEventService = powerbi.extensibility.IVisualEventService; +import ILocalVisualStorageService = powerbi.extensibility.ILocalVisualStorageService +import IVisualLicenseManager = powerbi.extensibility.IVisualLicenseManager; +import IVisualLocalStorageV2Service = powerbi.extensibility.IVisualLocalStorageV2Service +import IWebAccessService = powerbi.extensibility.IWebAccessService; +import IAcquireAADTokenService = powerbi.extensibility.IAcquireAADTokenService; +import ModalDialogResult = powerbi.extensibility.visual.ModalDialogResult +import HostCapabilities = powerbi.extensibility.HostCapabilities; +import IVisualSubSelectionService = powerbi.extensibility.IVisualSubSelectionService import { MockILocale } from "./mockILocale"; import { MockITooltipService } from "./mockITooltipService"; @@ -38,49 +58,46 @@ import { MockISelectionId } from "./mockISelectionId"; import { MockIColorPalette } from "./mockIColorPalette"; import { MockIVisualHost } from "./mockVisualHost"; import { MockIEventService } from "./mockIEventService"; -import { MockIStorageService, ILocalVisualStorageService } from "./mockIStorageService"; +import { MockIStorageService } from "./mockIStorageService"; +import { MockIStorageV2Service } from "./mockIStorageV2Service"; import { MockHostCapabilities } from "./mockHostCapabilities"; import { MockDownloadService } from "./mockDownloadService"; import { MockIVisualLicenseManager } from "./mockIVisualLicenseManager"; import { MockIWebAccessService } from "./mockIWebAccessService"; -// powerbi -import IColorInfo = powerbi.IColorInfo; - -// powerbi.visuals -import ISelectionIdBuilder = powerbi.visuals.ISelectionIdBuilder; -import ISelectionId = powerbi.visuals.ISelectionId; - -// powerbi.extensibility -import IColorPalette = powerbi.extensibility.ISandboxExtendedColorPalette; -import ISelectionManager = powerbi.extensibility.ISelectionManager; -import IVisualHost = powerbi.extensibility.visual.IVisualHost; -import IDownloadService = powerbi.extensibility.IDownloadService; -import HostCapabilities = powerbi.extensibility.HostCapabilities; -import IVisualLicenseManager = powerbi.extensibility.IVisualLicenseManager; -import IWebAccessService = powerbi.extensibility.IWebAccessService; -import IAcquireAADTokenService = powerbi.extensibility.IAcquireAADTokenService; -import ModalDialogResult = powerbi.extensibility.visual.ModalDialogResult -import {MockIAcquireAADTokenService} from "./mockIAcquireAADTokenService"; +import { MockIAcquireAADTokenService } from "./mockIAcquireAADTokenService"; +import { MockSubSelectionService } from "./mockSubSelectionService"; +export interface CreateVisualHostOptions { // eslint-disable-next-line @typescript-eslint/ban-types -export function createVisualHost(locale?: Object, allowInteractions?: boolean, colors?: IColorInfo[], isEnabled?: boolean, displayNames?: any, token?: string, modalDialogResult?: ModalDialogResult): IVisualHost { - return new MockIVisualHost( - createColorPalette(colors), - createSelectionManager(), - createTooltipService(isEnabled), - createLocale(locale), - createLocalizationManager(displayNames), - createTelemetryService(), - createAuthenticationService(token), - createStorageService(), - createEventService(), - createHostCapabilities(), - createDownloadService(), - licenseManager(), - webAccessService(), - acquireAADTokenService(), + locale?: Object, + allowInteractions?: boolean, + colors?: IColorInfo[], + isEnabled?: boolean, + displayNames?: any, + token?: string, + modalDialogResult?: ModalDialogResult +} + +export function createVisualHost({locale, allowInteractions, colors, isEnabled, displayNames, token, modalDialogResult}: CreateVisualHostOptions): IVisualHost { + return new MockIVisualHost({ + colorPalette: createColorPalette(colors), + selectionManager: createSelectionManager(), + subSelectionService: createSubSelectionService(), + tooltipServiceInstance: createTooltipService(isEnabled), + localeInstance: createLocale(locale), + localizationManager: createLocalizationManager(displayNames), + telemetryService: createTelemetryService(), + authService: createAuthenticationService(token), + storageService: createStorageService(), + storageV2Service: createStorageV2Service(), + eventService: createEventService(), + hostCapabilities: createHostCapabilities(allowInteractions), + downloadService: createDownloadService(), + licenseManager: licenseManager(), + webAccessService: webAccessService(), + acquireAADTokenService: acquireAADTokenService(), modalDialogResult - ) + }) } export function createColorPalette(colors?: IColorInfo[]): IColorPalette { @@ -124,12 +141,16 @@ export function createStorageService(): ILocalVisualStorageService { return new MockIStorageService(); } +export function createStorageV2Service(): IVisualLocalStorageV2Service { + return new MockIStorageV2Service(); +} + export function createEventService(): IVisualEventService { return new MockIEventService(); } -export function createHostCapabilities(): HostCapabilities { - return new MockHostCapabilities(); +export function createHostCapabilities(allowInteractions): HostCapabilities { + return new MockHostCapabilities(allowInteractions); } export function createDownloadService(): IDownloadService { @@ -147,3 +168,7 @@ export function webAccessService(): IWebAccessService { export function acquireAADTokenService(): IAcquireAADTokenService { return new MockIAcquireAADTokenService(); } + +export function createSubSelectionService(): IVisualSubSelectionService { + return new MockSubSelectionService(); +} diff --git a/test/mocks/mockIStorageServiceTest.ts b/test/mocks/mockIStorageServiceTest.ts index 7cd2f3f..75e7f7b 100644 --- a/test/mocks/mockIStorageServiceTest.ts +++ b/test/mocks/mockIStorageServiceTest.ts @@ -23,8 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ - -import { ILocalVisualStorageService } from "../../src/mocks/mockIStorageService"; +import powerbi from "powerbi-visuals-api"; +import ILocalVisualStorageService = powerbi.extensibility.ILocalVisualStorageService import { createStorageService } from "../../src/mocks/mocks"; const keyToBeStored: string = "LS_KEY"; @@ -51,7 +51,7 @@ describe("MockIStorageService", () => { it("MockIStorageService.remove method test", () => { localStorage.setItem(keyToBeStored, objectToBeStoredStringifyed); - let localStorageItem: string = localStorage.getItem(keyToBeStored); + let localStorageItem: string | null = localStorage.getItem(keyToBeStored); expect(localStorageItem).toBeTruthy(); mockStorageService.remove(keyToBeStored); @@ -61,7 +61,7 @@ describe("MockIStorageService", () => { it("MockIStorageService.set method test", (done) => { mockStorageService.set(keyToBeStored, objectToBeStoredStringifyed).then((data: number) => { - const localStorageItem: string = localStorage.getItem(keyToBeStored); + const localStorageItem: string | null = localStorage.getItem(keyToBeStored); expect(localStorageItem).toBeTruthy(); expect(localStorageItem).toEqual(objectToBeStoredStringifyed); expect(data).toEqual(objectToBeStoredStringifyed.length); @@ -70,8 +70,8 @@ describe("MockIStorageService", () => { }); it("MockIStorageService.get method test", (done) => { - const localStorageItem: string = localStorage.getItem(keyToBeStored); - mockStorageService.get(keyToBeStored).then((data: string) => { + const localStorageItem: string | null = localStorage.getItem(keyToBeStored); + mockStorageService.get(keyToBeStored).then((data: string | null) => { expect(data).toEqual(localStorageItem); done(); }); diff --git a/test/mocks/mockIStorageV2ServiceTest.ts b/test/mocks/mockIStorageV2ServiceTest.ts new file mode 100644 index 0000000..79b4f16 --- /dev/null +++ b/test/mocks/mockIStorageV2ServiceTest.ts @@ -0,0 +1,80 @@ +/* + * Power BI Visualizations + * + * Copyright (c) Microsoft Corporation + * All rights reserved. + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the ""Software""), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +import powerbi from "powerbi-visuals-api"; +import IVisualLocalStorageV2Service = powerbi.extensibility.IVisualLocalStorageV2Service +import StorageV2ResultInfo = powerbi.extensibility.StorageV2ResultInfo +import { createStorageV2Service } from "../../src/mocks/mocks"; + +const keyToBeStored: string = "LS_KEY"; +const objectToBeStored = { + keyDigit: 1, + keyString: "Hello", + keyArray: [1, "s4", false], + keyObject: { + key0: 11, + key1: "Hello", + key2: { + a: 13 + } + } +}; + +describe("MockIStorageV2Service", () => { + let mockStorageService: IVisualLocalStorageV2Service; + const objectToBeStoredStringifyed: string = JSON.stringify(objectToBeStored); + + beforeAll(() => { + mockStorageService = createStorageV2Service(); + }); + + it("MockIStorageV2Service.remove method test", () => { + localStorage.setItem(keyToBeStored, objectToBeStoredStringifyed); + let localStorageItem: string | null = localStorage.getItem(keyToBeStored); + expect(localStorageItem).toBeTruthy(); + + mockStorageService.remove(keyToBeStored); + localStorageItem = localStorage.getItem(keyToBeStored); + expect(localStorageItem).toBeNull(); + }); + + it("MockIStorageV2Service.set method test", (done) => { + mockStorageService.set(keyToBeStored, objectToBeStoredStringifyed).then((data: StorageV2ResultInfo) => { + const localStorageItem: string | null = localStorage.getItem(keyToBeStored); + expect(localStorageItem).toBeTruthy(); + expect(localStorageItem).toEqual(objectToBeStoredStringifyed); + expect(data.success).toBeTrue(); + done(); + }); + }); + + it("MockIStorageV2Service.get method test", (done) => { + const localStorageItem: string | null = localStorage.getItem(keyToBeStored); + mockStorageService.get(keyToBeStored).then((data: string | null) => { + expect(data).toEqual(localStorageItem); + done(); + }); + }); +}); \ No newline at end of file diff --git a/test/mocks/mockVisualHostTest.ts b/test/mocks/mockVisualHostTest.ts index 525c70c..319d0f5 100644 --- a/test/mocks/mockVisualHostTest.ts +++ b/test/mocks/mockVisualHostTest.ts @@ -32,7 +32,7 @@ describe("MockIVisualHost", () => { let visualHost: IVisualHost; beforeEach(() => { - visualHost = createVisualHost(); + visualHost = createVisualHost({}); }); describe("createSelectionIdBuilder", () => {