Skip to content

Commit fe23dea

Browse files
committed
Add test on dialog
1 parent 156b357 commit fe23dea

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

ui-tests/tests/collaborationpanel.spec.ts

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,35 @@ test('collaboration panel should contains two items', async ({ page }) => {
4747
expect(panel.locator('.jp-CollaboratorsList .jp-Collaborator')).toHaveCount(0);
4848
});
4949

50+
test.describe('User info panel', () => {
51+
test('should contain the user info icon', async ({ page }) => {
52+
const panel = await openPanel(page);
53+
const userInfoIcon = panel.locator('.jp-UserInfo-Icon');
54+
expect(userInfoIcon).toHaveCount(1);
55+
});
56+
57+
test('should open the user info dialog', async ({ page }) => {
58+
const panel = await openPanel(page);
59+
const userInfoIcon = panel.locator('.jp-UserInfo-Icon');
60+
await userInfoIcon.click();
61+
62+
const dialog = page.locator('.jp-Dialog-body');
63+
expect(dialog).toHaveCount(1);
64+
65+
const userInfoPanel = page.locator('.jp-UserInfoPanel');
66+
expect(userInfoPanel).toHaveCount(1);
67+
68+
const userName = page.locator('input[name="display_name"]');
69+
expect(userName).toHaveCount(1);
70+
expect(await userName.inputValue()).toBe('jovyan');
71+
72+
const cancelButton = page.locator(
73+
'.jp-Dialog-button .jp-Dialog-buttonLabel:has-text("Cancel")'
74+
);
75+
await cancelButton.click();
76+
expect(dialog).toHaveCount(0);
77+
});
78+
});
5079

5180
test.describe('One client', () => {
5281
let guestPage: IJupyterLabPageFixture;

0 commit comments

Comments
 (0)