tracker: fix tests, release 16.0 + 11.0 (assist)
This commit is contained in:
parent
8ba6a17055
commit
d43bc3a2e9
8 changed files with 20 additions and 11 deletions
Binary file not shown.
|
|
@ -1,3 +1,7 @@
|
|||
## 11.0.0
|
||||
|
||||
- migrate to native webrtc, remove peerjs
|
||||
|
||||
## 10.0.0
|
||||
|
||||
- memory handling improvements to prevent possible leaks on sessions with multiple canvas nodes
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "@openreplay/tracker-assist",
|
||||
"description": "Tracker plugin for screen assistance through the WebRTC",
|
||||
"version": "10.0.2",
|
||||
"version": "11.0.0",
|
||||
"keywords": [
|
||||
"WebRTC",
|
||||
"assistance",
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
export const pkgVersion = "10.0.2";
|
||||
export const pkgVersion = "11.0.0";
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
## 16.0.0
|
||||
|
||||
- **[breaking]** new string dictionary message format
|
||||
|
||||
## 15.0.5
|
||||
|
||||
- update medv/finder to 4.0.2 for better support of css-in-js libs
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "@openreplay/tracker",
|
||||
"description": "The OpenReplay tracker main package",
|
||||
"version": "16.0.0-beta.4",
|
||||
"version": "16.0.0",
|
||||
"keywords": [
|
||||
"logging",
|
||||
"replay"
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import { StringDictionary } from '../main/modules/attributeSender.js'
|
|||
|
||||
describe('StringDictionary', () => {
|
||||
test('key is non-zero', () => {
|
||||
const dict = new StringDictionary(() => 1)
|
||||
const dict = new StringDictionary()
|
||||
|
||||
const [key, isNew] = dict.getKey('We are Asayer')
|
||||
|
||||
|
|
@ -12,7 +12,7 @@ describe('StringDictionary', () => {
|
|||
})
|
||||
|
||||
test('Different strings have different keys', () => {
|
||||
const dict = new StringDictionary(() => 1)
|
||||
const dict = new StringDictionary()
|
||||
|
||||
const [key1, isNew1] = dict.getKey('Datadog')
|
||||
const [key2, isNew2] = dict.getKey('PostHog')
|
||||
|
|
@ -22,7 +22,7 @@ describe('StringDictionary', () => {
|
|||
})
|
||||
|
||||
test('Similar strings have similar keys', () => {
|
||||
const dict = new StringDictionary(() => 1)
|
||||
const dict = new StringDictionary()
|
||||
|
||||
const [key1, isNew1] = dict.getKey("What's up?")
|
||||
const [key2, isNew2] = dict.getKey("What's up?")
|
||||
|
|
|
|||
|
|
@ -29,11 +29,12 @@ describe('AttributeSender', () => {
|
|||
const name = 'color' // 1_1
|
||||
const value = 'red' // attribute is second, so 1_2; (page_key)
|
||||
// @ts-ignore
|
||||
const expectedMessage = [Type.SetNodeAttributeDict, id, '1_1', '1_2']
|
||||
|
||||
attributeSender.sendSetAttribute(id, name, value)
|
||||
|
||||
expect(sendSpy).toHaveBeenCalledWith(expectedMessage)
|
||||
expect(sendSpy).toHaveBeenCalledWith(
|
||||
expect.arrayContaining([Type.SetNodeAttributeDictGlobal, id, expect.any(Number), expect.any(Number)])
|
||||
)
|
||||
})
|
||||
|
||||
test('should apply dictionary to the attribute name and value', () => {
|
||||
|
|
@ -47,7 +48,7 @@ describe('AttributeSender', () => {
|
|||
expect(sendSpy).toHaveBeenCalledWith(
|
||||
expect.arrayContaining([
|
||||
// @ts-ignore
|
||||
Type.SetNodeAttributeDict,
|
||||
Type.SetNodeAttributeDictGlobal,
|
||||
id,
|
||||
expect.any(Number),
|
||||
expect.any(Number),
|
||||
|
|
@ -64,7 +65,7 @@ describe('AttributeSender', () => {
|
|||
attributeSender.sendSetAttribute(id, name, value)
|
||||
|
||||
// @ts-ignore
|
||||
expect(sendSpy).toHaveBeenCalledWith([Type.StringDict, '1_1', name])
|
||||
expect(sendSpy).toHaveBeenCalledWith(expect.arrayContaining([Type.StringDictGlobal, expect.any(Number), name]))
|
||||
})
|
||||
|
||||
test('should not send the string dictionary entry if the attribute already exists', () => {
|
||||
|
|
@ -98,7 +99,7 @@ describe('AttributeSender', () => {
|
|||
expect(sendSpy).toHaveBeenCalledTimes(6)
|
||||
expect(sendSpy).toHaveBeenCalledWith(
|
||||
// @ts-ignore
|
||||
expect.arrayContaining([Type.StringDict, expect.any(Number), name]),
|
||||
expect.arrayContaining([Type.StringDictGlobal, expect.any(Number), name]),
|
||||
)
|
||||
})
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue