Skip to content

Commit c71f31f

Browse files
committed
Reactivate all text editor tests
Due to the Monaco uplift, we had to temporarily skip a test, because it affected the default preference regarding auto-save. To re-enable the test, we now explicitly set the auto save preference to `off` before the test. This way the preference value is ensured to be consistent. See also #10736 Fixes #10891 Change-Id: I6ab22a71848e174313a30f9121cb4b3dec363f12
1 parent 14997ad commit c71f31f

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

examples/playwright/tests/theia-text-editor.test.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
// *****************************************************************************
1616

1717
import { expect } from '@playwright/test';
18+
import { DefaultPreferences, PreferenceIds, TheiaPreferenceView } from '../src/theia-preference-view';
1819
import { TheiaApp } from '../src/theia-app';
1920
import { TheiaTextEditor } from '../src/theia-text-editor';
2021
import { TheiaWorkspace } from '../src/theia-workspace';
@@ -27,6 +28,11 @@ test.describe('Theia Text Editor', () => {
2728
test.beforeAll(async () => {
2829
const ws = new TheiaWorkspace(['tests/resources/sample-files1']);
2930
app = await TheiaApp.load(page, ws);
31+
32+
// set auto-save preference to off
33+
const preferenceView = await app.openPreferences(TheiaPreferenceView);
34+
await preferenceView.setOptionsPreferenceById(PreferenceIds.Editor.AutoSave, DefaultPreferences.Editor.AutoSave.Off);
35+
await preferenceView.close();
3036
});
3137

3238
test('should be visible and active after opening "sample.txt"', async () => {
@@ -164,7 +170,7 @@ test.describe('Theia Text Editor', () => {
164170
await sampleTextEditor.saveAndClose();
165171
});
166172

167-
test.skip('should close without saving', async () => {
173+
test('should close without saving', async () => {
168174
const sampleTextEditor = await app.openEditor('sample.txt', TheiaTextEditor);
169175
await sampleTextEditor.replaceLineWithLineNumber('change again', 1);
170176
expect(await sampleTextEditor.isDirty()).toBe(true);

0 commit comments

Comments
 (0)