| Total Complexity | 2 |
| Complexity/F | 1 |
| Lines of Code | 20 |
| Function Count | 2 |
| Duplicated Lines | 0 |
| Ratio | 0 % |
| Changes | 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'); |
||
|
|
|||
| 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 |
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.