Giter VIP home page Giter VIP logo

powerbi-visuals-utils-testutils's Introduction

Microsoft Power BI visuals TestUtils

Build npm version npm

TestUtils is a set of mocks and fakes in order to simplify unit testing for Power BI custom visuals

Usage

2.3.0 Migration note

From version 2.3.0 testDom function returns HTMLElement instead of JQuery object. If you are using JQuery in tests, wrap the testDom calls with $(...) for compatibility:

    // 2.2.1 and below
    let element: JQuery = testDom("100", "100");
    // 2.3.0 and above
    let element: JQuery = $(testDom("100", "100"));

The motivation is not to force JQuery usage. It might be not necessary in tests. In lots of cases element.get(0) is the next operation after receiving an element with testDom. Now JQuery is not required to use powerbi-visuals-utils-testutils, so you can drop this dependency. If you keep it, you can easily migrate your code to 2.3.* version using the example above.

Contributing

License

See the LICENSE file for license rights and limitations (MIT).

powerbi-visuals-utils-testutils's People

Contributors

adiletelf avatar alekssavelev avatar asanov-webdev avatar avisander avatar blackleaden avatar demonkratiy avatar dependabot[bot] avatar eugeneelkin avatar ignatvilesov avatar kulljul avatar microsoft-github-policy-service[bot] avatar mulyukovaidar avatar mvgaliev avatar natalya-smirnova avatar savvinsergey avatar uve avatar vtkalek avatar zbritva avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

powerbi-visuals-utils-testutils's Issues

Missing IColorPalette isHighContrast, foreground, background, ... properties

Since the mockIColorPalette.ts file contains the default implementation of isHighContrast, foreground, background, etc... properties of IColorPalette, the produced mockIColorPalette.js file on npm package don't.

I had to manually update the code by adding the following code inside export class MockIColorPalette { }:

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 };

Can you please recompile the source files and update the package?

Thanks!

typings install issue

i ran the following command and got a warning or error. I wanted to see if this was correct or if i need to update.
`...>typings install --save --global dtd3#0.0.0+20160907005744 dtjasmine#2.5.0+20161025102649 dtjasmine-jquery#0.0.0+20160317120654 dtjquery#1.10.0+2016092916
2922 dt~lodash#4.14.0+20161028154038

typings WARN deprecated 5/9/2016: "registry:dt/jasmine-jquery#0.0.0+20160317120654" is deprecated (updated, replaced or removed)

typings WARN deprecated 11/10/2016: "registry:dt/lodash#4.14.0+20161028154038" is deprecated (updated, replaced or removed)

typings INFO reference Stripped reference "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/7de6c3dd94feaeb21f20054b9f30d5dabc5efabd/jasmine/jasmine.d.ts" during installation
from "jasmine-jquery" (main)

typings INFO reference Stripped reference "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/7de6c3dd94feaeb21f20054b9f30d5dabc5efabd/jquery/jquery.d.ts" during installation f
rom "jasmine-jquery" (main)

d3
`-- (No dependencies)

jasmine
`-- (No dependencies)

jasmine-jquery
`-- (No dependencies)

jquery
`-- (No dependencies)

lodash
-- (No dependencies)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.