Skip to content

Commit 8a6cae6

Browse files
authored
chore: Move helper to E2E test (RocketChat#37546)
1 parent 9f77c72 commit 8a6cae6

2 files changed

Lines changed: 13 additions & 15 deletions

File tree

apps/meteor/client/lib/utils/createToken.ts

Lines changed: 0 additions & 14 deletions
This file was deleted.

apps/meteor/tests/e2e/omnichannel/omnichannel-contact-center.spec.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,23 @@
1+
import { randomBytes } from 'crypto';
2+
13
import { faker } from '@faker-js/faker';
24

3-
import { createToken } from '../../../client/lib/utils/createToken';
45
import { Users } from '../fixtures/userStates';
56
import { OmnichannelContacts } from '../page-objects/omnichannel-contacts-list';
67
import { OmnichannelSection } from '../page-objects/omnichannel-section';
78
import { test, expect } from '../utils/test';
89

10+
const createToken = (): string => {
11+
const array = new Uint8Array(16);
12+
13+
const buffer = randomBytes(16);
14+
array.set(buffer);
15+
16+
return Array.from(array)
17+
.map((byte) => byte.toString(16).padStart(2, '0'))
18+
.join('');
19+
};
20+
921
const createContact = (generateToken = false) => ({
1022
id: null,
1123
name: `${faker.person.firstName()} ${faker.person.lastName()}`,

0 commit comments

Comments
 (0)