-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathchangeMode.spec.ts
More file actions
36 lines (27 loc) · 1.2 KB
/
changeMode.spec.ts
File metadata and controls
36 lines (27 loc) · 1.2 KB
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
import { test, expect } from '@playwright/test';
import {forceEditorMode, getCurrentEditorMode, openApp} from "./utils";
import {SessionMode} from "../src/store/sessionMode";
test('Change the mode to Schema Editor', async ({ page }) => {
// Go to the app
await openApp(page);
// Check that the current mode is Data Editor
const currentMode = await getCurrentEditorMode(page);
expect(currentMode).toBe(SessionMode.DataEditor);
// Change the mode to Schema Editor
await forceEditorMode(page, SessionMode.SchemaEditor);
// Check that the current mode is Schema Editor
const newMode = await getCurrentEditorMode(page);
expect(newMode).toBe(SessionMode.SchemaEditor);
});
test('Change the mode to Settings Editor', async ({ page }) => {
// Go to the app
await openApp(page);
// Check that the current mode is Data Editor
const currentMode = await getCurrentEditorMode(page);
expect(currentMode).toBe(SessionMode.DataEditor);
// Change the mode to Settings
await forceEditorMode(page, SessionMode.Settings);
// Check that the current mode is Settings
const newMode = await getCurrentEditorMode(page);
expect(newMode).toBe(SessionMode.Settings);
});