-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
ui-test-_misc.js
51 lines (26 loc) · 1.48 KB
/
ui-test-_misc.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
const kDefaultRoute = 'file://' + __dirname + '/index.html';
describe('DCInvite_Misc', () => {
before(() => DCVisit(kDefaultRoute));
it('removes placeholder', () => expect(page.locator('#name')).toHaveText(''));
it('sets input autofocus', () => expect(page.locator('textarea')).toHaveAttribute('autofocus', ''));
context('enter info', () => {
before(() => page.getByRole('textbox').fill('OPENPGP4FPR:F085B63BE151EF3B8ACCE5D677B218ED4BCB8DCB#a=alfa%40bravo.charlie&n=delta&i=echo&s=foxtrot'));
it('sets share-link target', () => expect(page.locator('.share-link')).toHaveAttribute('target', '_blank'));
it('sets share-link href', () => expect(page.locator('.share-link')).toHaveAttribute('href', '#F085B63BE151EF3B8ACCE5D677B218ED4BCB8DCB&a=alfa%40bravo.charlie&n=delta&i=echo&s=foxtrot'));
});
context('address', () => {
const address = Math.random().toString();
before(() => DCVisit(kDefaultRoute + '#&a=' + address));
it('binds address', () => expect(page.locator('#name')).toHaveText(address));
});
context('name', () => {
const name = Math.random().toString();
before(() => DCVisit(kDefaultRoute + '#&a=alfa&g=bravo&n=' + name));
it('binds name', () => expect(page.locator('#name')).toHaveText(name));
});
context('group', () => {
const group = Math.random().toString();
before(() => DCVisit(kDefaultRoute + '#&a=alfa&g=' + group));
it('binds group', () => expect(page.locator('#name')).toHaveText(group));
});
});