| Total Complexity | 3 |
| Complexity/F | 1 |
| Lines of Code | 17 |
| Function Count | 3 |
| Duplicated Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | /** |
||
| 5 | import dom from 'src/core/service/utils/dom.utils'; |
||
| 6 | |||
| 7 | Object.assign(navigator, { |
||
|
|
|||
| 8 | clipboard: { |
||
| 9 | writeText: () => {}, |
||
| 10 | }, |
||
| 11 | }); |
||
| 12 | |||
| 13 | describe('src/core/service/utils/dom.utils.ts', () => { |
||
| 14 | it('should use the Clipboard API to copy texts', () => { |
||
| 15 | jest.spyOn(navigator.clipboard, 'writeText'); |
||
| 16 | |||
| 17 | dom.copyStringToClipboard('string to be copied'); |
||
| 18 | |||
| 19 | expect(navigator.clipboard.writeText).toHaveBeenCalledWith('string to be copied'); |
||
| 20 | }); |
||
| 21 | }); |
||
| 22 |
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.