Skip to content

Commit 8f38e8a

Browse files
committed
test: color preview click toggles quick edit
1 parent 637f05e commit 8f38e8a

File tree

1 file changed

+33
-1
lines changed

1 file changed

+33
-1
lines changed

test/spec/Extn-CSSColorPreview-integ-test.js

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,39 @@ define(function (require, exports, module) {
214214
await __PR.closeFile();
215215
});
216216

217-
// todo test code changes, code changes at end of file, toggle color edit
217+
it(`should toggle quick edit on single colors ${fileName}`, async function () {
218+
const editor = await init();
219+
let gutterMarker = editor.getGutterMarker(8, GUTTER_NAME);
220+
__PR.validateEqual(areColorsEqual($(gutterMarker), "blue"), true);
221+
gutterMarker.click();
222+
await __PR.awaitsFor(()=>{
223+
return __PR.$(".CodeMirror-linewidget").length === 1;
224+
}, "quick edit to appear");
225+
gutterMarker.click();
226+
await __PR.awaitsFor(()=>{
227+
return __PR.$(".CodeMirror-linewidget").length === 0;
228+
}, "quick edit to go");
229+
await __PR.closeFile();
230+
});
231+
232+
it(`should toggle quick edit on multiple colors ${fileName}`, async function () {
233+
const editor = await init();
234+
let gutterMarker = editor.getGutterMarker(15, GUTTER_NAME);
235+
const individualColors = $(gutterMarker).find(".color-box");
236+
individualColors[0].click();
237+
await __PR.awaitsFor(()=>{
238+
return __PR.$(".CodeMirror-linewidget").length === 1 &&
239+
areColorsEqual(__PR.$(".CodeMirror-linewidget").find(".original-color")[0], "#ff0090");
240+
}, "quick edit to color #ff0090 appear");
241+
individualColors[2].click();
242+
await __PR.awaitsFor(()=>{
243+
return __PR.$(".CodeMirror-linewidget").length === 1 &&
244+
areColorsEqual(__PR.$(".CodeMirror-linewidget").find(".original-color")[0], "#954e3e");
245+
}, "quick edit to color #954e3e appear");
246+
await __PR.closeFile();
247+
});
248+
249+
// todo test code changes, code changes at end of file
218250
}
219251

220252
const htmlFiles = ["a.html", "a.htm", "a.xhtml", "a.php", "a.jsp", "a.jsx", "a.tsx"];

0 commit comments

Comments
 (0)