Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(jest): 65% coverage for store/settings/actions #2965

Merged
merged 2 commits into from
Apr 22, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
122 changes: 0 additions & 122 deletions store/settings/actions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ describe('actions.default', () => {
try {
await actions.default.setConsentScan({ commit }, true)
} catch (error) {
console.log(2)
expect(commit).toHaveBeenCalledWith('setConsentScan', true)
expect(error).toBeInstanceOf(Error)
expect(error).toHaveProperty(
Expand All @@ -79,124 +78,3 @@ describe('actions.default', () => {
expect(TMConstructor.userInfoManager.setConsent).toHaveBeenCalled()
})
})

describe('actions.default.setConsentScan', () => {
test('0', async () => {
const param2: any = [
['C:\\\\path\\to\\folder\\', 'C:\\\\path\\to\\folder\\', '.', '.'],
[
'/path/to/file',
'C:\\\\path\\to\\folder\\',
'./path/to/file',
'path/to/file.ext',
],
[
'path/to/file.ext',
'path/to/file.ext',
'./path/to/file',
'path/to/folder/',
],
['.', './path/to/file', './path/to/file', 'C:\\\\path\\to\\file.ext'],
]
await actions.default.setConsentScan(
'commit f20ba84baadcbd1f3a45d95e9bb5aef588f4e902\r\nAuthor: Marty Douglas <Rubie_Boehm29@yahoo.com>\r\nDate: Thu Jul 29 2021 09:06:18 GMT+0200 (Central European Summer Time)\r\n\r\n    override solid state microchip\r\n',
param2,
)
})

test('1', async () => {
const param2: any = [
['path/to/file.ext', '.', './path/to/file', 'C:\\\\path\\to\\folder\\'],
[
'/path/to/file',
'./path/to/file',
'C:\\\\path\\to\\file.ext',
'/path/to/file',
],
['.', 'C:\\\\path\\to\\folder\\', '.', 'C:\\\\path\\to\\folder\\'],
[
'.',
'path/to/folder/',
'C:\\\\path\\to\\folder\\',
'C:\\\\path\\to\\folder\\',
],
]
await actions.default.setConsentScan(
'commit 03ccef2ffa982df061ae86ca8730cd9ad0af05b3\r\nAuthor: Ladarius Zboncak <Ricky.Schultz37@hotmail.com>\r\nDate: Wed Jul 28 2021 16:52:11 GMT+0200 (Central European Summer Time)\r\n\r\n    program wireless program\r\n',
param2,
)
})

test('2', async () => {
const param2: any = [
['.', '.', 'path/to/file.ext', './path/to/file'],
[
'C:\\\\path\\to\\file.ext',
'/path/to/file',
'C:\\\\path\\to\\file.ext',
'C:\\\\path\\to\\file.ext',
],
[
'/path/to/file',
'C:\\\\path\\to\\file.ext',
'./path/to/file',
'C:\\\\path\\to\\folder\\',
],
['/path/to/file', '.', 'path/to/file.ext', 'C:\\\\path\\to\\folder\\'],
]
await actions.default.setConsentScan(
'commit f20ba84baadcbd1f3a45d95e9bb5aef588f4e902\r\nAuthor: Marty Douglas <Rubie_Boehm29@yahoo.com>\r\nDate: Thu Jul 29 2021 09:06:18 GMT+0200 (Central European Summer Time)\r\n\r\n    override solid state microchip\r\n',
param2,
)
})

test('3', async () => {
const param2: any = [
[
'C:\\\\path\\to\\folder\\',
'C:\\\\path\\to\\file.ext',
'./path/to/file',
'./path/to/file',
],
['./path/to/file', '.', '/path/to/file', '/path/to/file'],
['./path/to/file', '.', '.', '.'],
['.', '.', '/path/to/file', 'C:\\\\path\\to\\folder\\'],
]
await actions.default.setConsentScan(
'commit f20ba84baadcbd1f3a45d95e9bb5aef588f4e902\r\nAuthor: Marty Douglas <Rubie_Boehm29@yahoo.com>\r\nDate: Thu Jul 29 2021 09:06:18 GMT+0200 (Central European Summer Time)\r\n\r\n    override solid state microchip\r\n',
param2,
)
})

test('4', async () => {
const param2: any = [
[
'path/to/file.ext',
'C:\\\\path\\to\\folder\\',
'C:\\\\path\\to\\folder\\',
'/path/to/file',
],
[
'path/to/folder/',
'path/to/file.ext',
'C:\\\\path\\to\\folder\\',
'/path/to/file',
],
['path/to/folder/', 'path/to/folder/', '/path/to/file', '/path/to/file'],
[
'./path/to/file',
'path/to/file.ext',
'path/to/file.ext',
'./path/to/file',
],
]
await actions.default.setConsentScan(
'commit 03ccef2ffa982df061ae86ca8730cd9ad0af05b3\r\nAuthor: Ladarius Zboncak <Ricky.Schultz37@hotmail.com>\r\nDate: Wed Jul 28 2021 16:52:11 GMT+0200 (Central European Summer Time)\r\n\r\n    program wireless program\r\n',
param2,
)
})

test('5', async () => {
await actions.default.setConsentScan('', [])
})
})