summaryrefslogtreecommitdiff
path: root/spec/frontend/ide/components/preview
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-11-06 09:06:23 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2019-11-06 09:06:23 +0000
commitd15180e00b209d0fbe3d8ce61b3af269aecdf7f5 (patch)
treee24bcc044a3e471811b91ade8a23120a27210c3f /spec/frontend/ide/components/preview
parent505c40d537244b35807129ade0c577f752e9d564 (diff)
downloadgitlab-ce-d15180e00b209d0fbe3d8ce61b3af269aecdf7f5.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/ide/components/preview')
-rw-r--r--spec/frontend/ide/components/preview/clientside_spec.js16
1 files changed, 15 insertions, 1 deletions
diff --git a/spec/frontend/ide/components/preview/clientside_spec.js b/spec/frontend/ide/components/preview/clientside_spec.js
index a7c74dc992a..6a33f4998c5 100644
--- a/spec/frontend/ide/components/preview/clientside_spec.js
+++ b/spec/frontend/ide/components/preview/clientside_spec.js
@@ -24,6 +24,9 @@ describe('IDE clientside preview', () => {
getFileData: jest.fn().mockReturnValue(Promise.resolve({})),
getRawFileData: jest.fn().mockReturnValue(Promise.resolve('')),
};
+ const storeClientsideActions = {
+ pingUsage: jest.fn().mockReturnValue(Promise.resolve({})),
+ };
const waitForCalls = () => new Promise(setImmediate);
@@ -42,6 +45,12 @@ describe('IDE clientside preview', () => {
...getters,
},
actions: storeActions,
+ modules: {
+ clientside: {
+ namespaced: true,
+ actions: storeClientsideActions,
+ },
+ },
});
wrapper = shallowMount(Clientside, {
@@ -76,7 +85,8 @@ describe('IDE clientside preview', () => {
describe('with main entry', () => {
beforeEach(() => {
createComponent({ getters: { packageJson: dummyPackageJson } });
- return wrapper.vm.initPreview();
+
+ return waitForCalls();
});
it('creates sandpack manager', () => {
@@ -95,6 +105,10 @@ describe('IDE clientside preview', () => {
},
);
});
+
+ it('pings usage', () => {
+ expect(storeClientsideActions.pingUsage).toHaveBeenCalledTimes(1);
+ });
});
describe('computed', () => {