UNPKG

3.29 kBJavaScriptView Raw
1/*
2 * MIT License
3 *
4 * Copyright (c) 2016 Microsoft
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a copy
7 * of this software and associated documentation files (the "Software"), to deal
8 * in the Software without restriction, including without limitation the rights
9 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 * copies of the Software, and to permit persons to whom the Software is
11 * furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice shall be included in all
14 * copies or substantial portions of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 * SOFTWARE.
23 */
24"use strict";
25require("powerbi-visuals/lib/powerbi-visuals");
26var jquery = require("jquery");
27var testSetup_1 = require("./testSetup"); // tslint:disable-line
28require("./mockPBI");
29testSetup_1.default["$"] = jquery;
30exports.Utils = {
31 FAKE_TABLE_DATA_ONE_COLUMN: {
32 metadata: {},
33 table: {
34 columns: [{
35 displayName: "COLUMN_1",
36 type: {
37 text: true,
38 },
39 }],
40 rows: [
41 ["COLUMN_1_ROW_1"],
42 ["COLUMN_1_ROW_2"],
43 ],
44 },
45 },
46 FAKE_TABLE_DATA_TWO_COLUMN: {
47 metadata: {},
48 table: {
49 columns: [{
50 displayName: "COLUMN_1",
51 type: {
52 text: true,
53 },
54 }, {
55 displayName: "COLUMN_2",
56 type: {
57 numeric: true,
58 },
59 }],
60 rows: [
61 ["COLUMN_1_ROW_1", 1],
62 ["COLUMN_1_ROW_2", 2],
63 ],
64 },
65 },
66 createElement: function () {
67 return $("<div>");
68 },
69 createUpdateOptionsWithSmallData: function () {
70 return {
71 viewport: {
72 width: 100,
73 height: 100,
74 },
75 dataViews: [exports.Utils.FAKE_TABLE_DATA_ONE_COLUMN],
76 };
77 },
78 createUpdateOptionsWithData: function () {
79 return {
80 viewport: {
81 width: 100,
82 height: 100,
83 },
84 dataViews: [exports.Utils.FAKE_TABLE_DATA_TWO_COLUMN],
85 };
86 },
87 createFakeHost: function () {
88 return {
89 persistProperties: function () { } // tslint:disable-line
90 };
91 },
92 createFakeInitOptions: function () {
93 return {
94 element: exports.Utils.createElement(),
95 host: exports.Utils.createFakeHost(),
96 viewport: {
97 width: 100,
98 height: 100,
99 },
100 };
101 },
102};
103//# sourceMappingURL=visualHelpers.js.map
\No newline at end of file