Skip to content

Commit 3035682

Browse files
committed
untitled - add tests for new setValue() method
1 parent b56b80e commit 3035682

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/vs/workbench/test/browser/parts/editor/untitledTextEditor.test.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,22 @@ suite('Untitled text editors', () => {
115115
});
116116
}
117117

118+
test('setValue()', async () => {
119+
const service = accessor.untitledTextEditorService;
120+
const untitled = service.create();
121+
122+
const model = await untitled.resolve();
123+
124+
model.setValue('not dirty', true);
125+
assert.ok(!model.isDirty());
126+
127+
model.setValue('dirty');
128+
assert.ok(model.isDirty());
129+
130+
untitled.dispose();
131+
model.dispose();
132+
});
133+
118134
test('associated resource is dirty', () => {
119135
const service = accessor.untitledTextEditorService;
120136
const file = URI.file(join('C:\\', '/foo/file.txt'));

0 commit comments

Comments
 (0)