@nebula.js/cli-sense 3.0.3 → 3.1.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nebula.js/cli-sense",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.1.0-alpha.0",
|
|
4
4
|
"description": "Build a supernova as a Qlik Sense extension",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "QlikTech International AB",
|
|
@@ -27,20 +27,20 @@
|
|
|
27
27
|
"lint": "eslint src"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@babel/cli": "7.
|
|
31
|
-
"@babel/core": "7.
|
|
32
|
-
"@babel/preset-env": "7.
|
|
33
|
-
"@nebula.js/stardust": "^3.0.
|
|
30
|
+
"@babel/cli": "7.19.3",
|
|
31
|
+
"@babel/core": "7.19.3",
|
|
32
|
+
"@babel/preset-env": "7.19.3",
|
|
33
|
+
"@nebula.js/stardust": "^3.1.0-alpha.0",
|
|
34
34
|
"@rollup/plugin-commonjs": "22.0.2",
|
|
35
|
-
"@rollup/plugin-node-resolve": "
|
|
35
|
+
"@rollup/plugin-node-resolve": "14.1.0",
|
|
36
36
|
"@rollup/plugin-replace": "4.0.0",
|
|
37
37
|
"extend": "3.0.2",
|
|
38
38
|
"fs-extra": "10.1.0",
|
|
39
39
|
"node-event-emitter": "0.0.1",
|
|
40
|
-
"rollup": "2.79.
|
|
40
|
+
"rollup": "2.79.1",
|
|
41
41
|
"rollup-plugin-babel": "4.4.0",
|
|
42
42
|
"rollup-plugin-terser": "7.0.2",
|
|
43
|
-
"yargs": "17.
|
|
43
|
+
"yargs": "17.6.0"
|
|
44
44
|
},
|
|
45
|
-
"gitHead": "
|
|
45
|
+
"gitHead": "06eb9b2d1876ac3abce9a1c749c0b428d3251481"
|
|
46
46
|
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import createSelections from '../selections';
|
|
2
|
+
|
|
3
|
+
describe('supernova-wrapper', () => {
|
|
4
|
+
describe('selections', () => {
|
|
5
|
+
let selectionsApi;
|
|
6
|
+
let selectionsApiActivateMock;
|
|
7
|
+
let selectionsApiDeactivateMock;
|
|
8
|
+
|
|
9
|
+
let backendApi;
|
|
10
|
+
let backendApiBeganSelectionMock;
|
|
11
|
+
let backendApiEndSelectionMock;
|
|
12
|
+
let backendApiResetSelectionMock;
|
|
13
|
+
let backendApiSwitchModalSelectionMock;
|
|
14
|
+
|
|
15
|
+
let selections;
|
|
16
|
+
let selectionsEmitMock;
|
|
17
|
+
|
|
18
|
+
beforeEach(() => {
|
|
19
|
+
selectionsApiActivateMock = jest.fn();
|
|
20
|
+
selectionsApiDeactivateMock = jest.fn();
|
|
21
|
+
|
|
22
|
+
backendApiBeganSelectionMock = jest.fn();
|
|
23
|
+
backendApiEndSelectionMock = jest.fn();
|
|
24
|
+
backendApiResetSelectionMock = jest.fn();
|
|
25
|
+
backendApiSwitchModalSelectionMock = jest.fn();
|
|
26
|
+
|
|
27
|
+
selectionsEmitMock = jest.fn();
|
|
28
|
+
|
|
29
|
+
selectionsApi = {
|
|
30
|
+
activated: selectionsApiActivateMock,
|
|
31
|
+
deactivated: selectionsApiDeactivateMock,
|
|
32
|
+
};
|
|
33
|
+
backendApi = {
|
|
34
|
+
beginSelections: backendApiBeganSelectionMock,
|
|
35
|
+
endSelections: backendApiEndSelectionMock,
|
|
36
|
+
model: {
|
|
37
|
+
resetMadeSelections: backendApiResetSelectionMock,
|
|
38
|
+
app: {
|
|
39
|
+
switchModalSelection: backendApiSwitchModalSelectionMock,
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
};
|
|
43
|
+
selections = createSelections({ selectionsApi, backendApi });
|
|
44
|
+
selections.emit = selectionsEmitMock;
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
it('should `begin`', () => {
|
|
48
|
+
selections.begin();
|
|
49
|
+
expect(selectionsApi.activated).toHaveBeenCalledWith(true);
|
|
50
|
+
expect(backendApi.beginSelections).toHaveBeenCalledWith();
|
|
51
|
+
expect(selections.emit).toHaveBeenCalledWith('activated');
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
it('should `begin` with paths', () => {
|
|
55
|
+
const paths = ['hypercubePath', 'otherHypercubePath'];
|
|
56
|
+
selections.begin(paths);
|
|
57
|
+
expect(selectionsApi.activated).toHaveBeenCalledWith(true);
|
|
58
|
+
expect(backendApi.beginSelections).toHaveBeenCalledTimes(0);
|
|
59
|
+
expect(backendApi.model.app.switchModalSelection).toHaveBeenCalledWith(backendApi.model, paths);
|
|
60
|
+
expect(selections.emit).toHaveBeenCalledWith('activated');
|
|
61
|
+
});
|
|
62
|
+
});
|
|
63
|
+
});
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import createSelections from '../selections';
|
|
2
|
-
|
|
3
|
-
describe('supernova-wrapper', () => {
|
|
4
|
-
describe('selections', () => {
|
|
5
|
-
let selectionsApi;
|
|
6
|
-
let backendApi;
|
|
7
|
-
let selections;
|
|
8
|
-
|
|
9
|
-
beforeEach(() => {
|
|
10
|
-
selectionsApi = {
|
|
11
|
-
activated: sinon.stub(),
|
|
12
|
-
deactivated: sinon.stub(),
|
|
13
|
-
};
|
|
14
|
-
backendApi = {
|
|
15
|
-
beginSelections: sinon.stub(),
|
|
16
|
-
endSelections: sinon.stub(),
|
|
17
|
-
model: {
|
|
18
|
-
resetMadeSelections: sinon.stub(),
|
|
19
|
-
app: {
|
|
20
|
-
switchModalSelection: sinon.stub(),
|
|
21
|
-
},
|
|
22
|
-
},
|
|
23
|
-
};
|
|
24
|
-
selections = createSelections({ selectionsApi, backendApi });
|
|
25
|
-
selections.emit = sinon.stub();
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
it('should `begin`', () => {
|
|
29
|
-
selections.begin();
|
|
30
|
-
expect(selectionsApi.activated).to.have.been.calledWithExactly(true);
|
|
31
|
-
expect(backendApi.beginSelections).to.have.been.calledWithExactly();
|
|
32
|
-
expect(selections.emit).to.have.been.calledWithExactly('activated');
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
it('should `begin` with paths', () => {
|
|
36
|
-
const paths = ['hypercubePath', 'otherHypercubePath'];
|
|
37
|
-
selections.begin(paths);
|
|
38
|
-
expect(selectionsApi.activated).to.have.been.calledWithExactly(true);
|
|
39
|
-
expect(backendApi.beginSelections).to.not.been.called;
|
|
40
|
-
expect(backendApi.model.app.switchModalSelection).to.have.been.calledWithExactly(backendApi.model, paths);
|
|
41
|
-
expect(selections.emit).to.have.been.calledWithExactly('activated');
|
|
42
|
-
});
|
|
43
|
-
});
|
|
44
|
-
});
|