Passed
Push — trunk ( 5d9bf1...024f41 )
by Christian
34:40 queued 22:07
created

src/Administration/Resources/app/administration/src/app/init-pre/state.init.spec.js   A

Complexity

Total Complexity 3
Complexity/F 1

Size

Lines of Code 45
Function Count 3

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 38
dl 0
loc 45
rs 10
c 0
b 0
f 0
wmc 3
mnd 0
bc 0
fnc 3
bpm 0
cpm 1
noi 2
1
import initState from 'src/app/init-pre/state.init';
2
3
describe('src/app/init-pre/state.init.ts', () => {
4
    initState();
5
6
    it('should contain all state methods', () => {
7
        expect(Shopware.State._store).toBeDefined();
0 ignored issues
show
Bug introduced by
The variable Shopware seems to be never declared. If this is a global, consider adding a /** global: Shopware */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
8
        expect(Shopware.State.list).toBeDefined();
9
        expect(Shopware.State.get).toBeDefined();
10
        expect(Shopware.State.getters).toBeDefined();
11
        expect(Shopware.State.commit).toBeDefined();
12
        expect(Shopware.State.dispatch).toBeDefined();
13
        expect(Shopware.State.watch).toBeDefined();
14
        expect(Shopware.State.subscribe).toBeDefined();
15
        expect(Shopware.State.subscribeAction).toBeDefined();
16
        expect(Shopware.State.registerModule).toBeDefined();
17
        expect(Shopware.State.unregisterModule).toBeDefined();
18
    });
19
20
    it('should initialized all state modules', () => {
21
        expect(Shopware.State.list()).toHaveLength(21);
0 ignored issues
show
Bug introduced by
The variable Shopware seems to be never declared. If this is a global, consider adding a /** global: Shopware */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
22
23
        expect(Shopware.State.get('notification')).toBeDefined();
24
        expect(Shopware.State.get('session')).toBeDefined();
25
        expect(Shopware.State.get('system')).toBeDefined();
26
        expect(Shopware.State.get('adminMenu')).toBeDefined();
27
        expect(Shopware.State.get('licenseViolation')).toBeDefined();
28
        expect(Shopware.State.get('context')).toBeDefined();
29
        expect(Shopware.State.get('error')).toBeDefined();
30
        expect(Shopware.State.get('settingsItems')).toBeDefined();
31
        expect(Shopware.State.get('shopwareApps')).toBeDefined();
32
        expect(Shopware.State.get('extensionEntryRoutes')).toBeDefined();
33
        expect(Shopware.State.get('marketing')).toBeDefined();
34
        expect(Shopware.State.get('extensionComponentSections')).toBeDefined();
35
        expect(Shopware.State.get('extensions')).toBeDefined();
36
        expect(Shopware.State.get('tabs')).toBeDefined();
37
        expect(Shopware.State.get('menuItem')).toBeDefined();
38
        expect(Shopware.State.get('extensionSdkModules')).toBeDefined();
39
        expect(Shopware.State.get('modals')).toBeDefined();
40
        expect(Shopware.State.get('extensionMainModules')).toBeDefined();
41
        expect(Shopware.State.get('actionButtons')).toBeDefined();
42
        expect(Shopware.State.get('ruleConditionsConfig')).toBeDefined();
43
        expect(Shopware.State.get('sdkLocation')).toBeDefined();
44
    });
45
});
46