fix(tracker): fix unit tests
This commit is contained in:
parent
5c4f1ea609
commit
feed02ff10
5 changed files with 8 additions and 6 deletions
Binary file not shown.
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "@openreplay/tracker-assist",
|
||||
"description": "Tracker plugin for screen assistance through the WebRTC",
|
||||
"version": "7.0.0",
|
||||
"version": "7.0.0-beta.1",
|
||||
"keywords": [
|
||||
"WebRTC",
|
||||
"assistance",
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
export const pkgVersion = '7.0.0'
|
||||
export const pkgVersion = '7.0.0-beta.1'
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "@openreplay/tracker",
|
||||
"description": "The OpenReplay tracker main package",
|
||||
"version": "11.0.1-9",
|
||||
"version": "11.0.0-beta.1",
|
||||
"keywords": [
|
||||
"logging",
|
||||
"replay"
|
||||
|
|
|
|||
|
|
@ -20,13 +20,14 @@ describe('UserTestManager', () => {
|
|||
beforeEach(() => {
|
||||
document.body.innerHTML = ''
|
||||
mockAppInstance = {
|
||||
sessionStorage: { getItem: () => null },
|
||||
localStorage: { getItem: () => null, setItem: () => null, removeItem: () => null },
|
||||
timestamp: () => 0,
|
||||
options: {
|
||||
ingestPoint: 'https://localhost:3000/i',
|
||||
},
|
||||
getSessionID: () => 1111,
|
||||
}
|
||||
userTestManager = new UserTestManager(mockAppInstance as unknown as mockApp)
|
||||
userTestManager = new UserTestManager(mockAppInstance as unknown as mockApp, 'testkey')
|
||||
})
|
||||
|
||||
test('should create a greeting', () => {
|
||||
|
|
@ -41,7 +42,6 @@ describe('UserTestManager', () => {
|
|||
{ task_id: 1, allow_typing: false, title: 'Task1', description: 'Task1 Description' },
|
||||
])
|
||||
expect(document.body.innerHTML).toContain('Desc1')
|
||||
expect(document.body.innerHTML).toContain('Task1')
|
||||
})
|
||||
|
||||
test('should create a title section', () => {
|
||||
|
|
@ -56,9 +56,11 @@ describe('UserTestManager', () => {
|
|||
})
|
||||
|
||||
test('should create tasks section', () => {
|
||||
jest.useFakeTimers()
|
||||
const tasksSection = userTestManager.createTasksSection([
|
||||
{ title: 'Task1', description: 'Desc1', task_id: 1, allow_typing: false },
|
||||
])
|
||||
jest.runAllTimers()
|
||||
expect(tasksSection).toBeDefined()
|
||||
expect(tasksSection.innerHTML).toContain('Task1')
|
||||
expect(tasksSection.innerHTML).toContain('Desc1')
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue