Passed
Push — trunk ( 58a8b0...e62b2a )
by Christian
12:52 queued 13s
created

src/Administration/Resources/app/administration/src/module/sw-inactivity-login/index.spec.js   A

Complexity

Total Complexity 2
Complexity/F 1

Size

Lines of Code 20
Function Count 2

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 14
mnd 0
bc 0
fnc 2
dl 0
loc 20
rs 10
bpm 0
cpm 1
noi 1
c 0
b 0
f 0
1
import 'src/module/sw-inactivity-login/index';
2
3
describe('src/module/sw-inactivity-login/page/index.ts', () => {
4
    it('should register module', () => {
5
        const module = Shopware.Module.getModuleRegistry().get('sw-inactivity-login');
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...
6
7
        expect(module !== undefined).toBe(true);
8
        expect(module.manifest.type).toBe('core');
9
        expect(module.manifest.name).toBe('inactivity-login');
10
        expect(module.routes.size).toBe(1);
11
12
        const route = module.routes.get('sw.inactivity.login.index');
13
        expect(route !== undefined).toBe(true);
14
        expect(route.path).toBe('/inactivity/login/:id');
15
16
        const props = route.props.default({ params: { id: 'foo' } });
17
        expect(props.hasOwnProperty('hash')).toBe(true);
18
        expect(props.hash).toBe('foo');
19
    });
20
});
21