tracker: fix jest config, update test cases
This commit is contained in:
parent
e7d309dadf
commit
829e1c8bde
4 changed files with 14 additions and 3 deletions
Binary file not shown.
|
|
@ -8,6 +8,14 @@ const config = {
|
|||
moduleNameMapper: {
|
||||
'(.+)\\.js': '$1',
|
||||
},
|
||||
globals: {
|
||||
'ts-jest': {
|
||||
tsConfig: {
|
||||
target: 'es2020',
|
||||
lib: ['DOM', 'ES2022'],
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
export default config
|
||||
|
|
|
|||
|
|
@ -23,6 +23,9 @@ describe('Console logging module', () => {
|
|||
safe: jest.fn((callback) => callback),
|
||||
send: jest.fn(),
|
||||
attachStartCallback: jest.fn(),
|
||||
sanitizer: {
|
||||
privateMode: false,
|
||||
},
|
||||
ticker: {
|
||||
attach: jest.fn(),
|
||||
},
|
||||
|
|
|
|||
|
|
@ -2,8 +2,8 @@ import { describe, expect, jest, afterEach, beforeEach, test } from '@jest/globa
|
|||
import Sanitizer, { SanitizeLevel, Options, stringWiper } from '../main/app/sanitizer.js'
|
||||
|
||||
describe('stringWiper', () => {
|
||||
test('should replace all characters with █', () => {
|
||||
expect(stringWiper('Sensitive Data')).toBe('██████████████')
|
||||
test('should replace all characters with *', () => {
|
||||
expect(stringWiper('Sensitive Data')).toBe('**************')
|
||||
})
|
||||
})
|
||||
|
||||
|
|
@ -126,7 +126,7 @@ describe('Sanitizer', () => {
|
|||
element.mockId = 1
|
||||
element.innerText = 'Sensitive Data'
|
||||
const sanitizedText = sanitizer.getInnerTextSecure(element)
|
||||
expect(sanitizedText).toEqual('██████████████')
|
||||
expect(sanitizedText).toEqual('**************')
|
||||
})
|
||||
|
||||
test('should return empty string if node element does not exist', () => {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue