Skip to content

Commit

Permalink
test: color preview click toggles quick edit
Browse files Browse the repository at this point in the history
  • Loading branch information
abose committed Dec 9, 2024
1 parent 93b1581 commit f9db349
Showing 1 changed file with 33 additions and 1 deletion.
34 changes: 33 additions & 1 deletion test/spec/Extn-CSSColorPreview-integ-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,39 @@ define(function (require, exports, module) {
await __PR.closeFile();
});

// todo test code changes, code changes at end of file, toggle color edit
it(`should toggle quick edit on single colors ${fileName}`, async function () {
const editor = await init();
let gutterMarker = editor.getGutterMarker(8, GUTTER_NAME);
__PR.validateEqual(areColorsEqual($(gutterMarker), "blue"), true);
gutterMarker.click();
await __PR.awaitsFor(()=>{
return __PR.$(".CodeMirror-linewidget").length === 1;
}, "quick edit to appear");
gutterMarker.click();
await __PR.awaitsFor(()=>{
return __PR.$(".CodeMirror-linewidget").length === 0;
}, "quick edit to go");
await __PR.closeFile();
});

it(`should toggle quick edit on multiple colors ${fileName}`, async function () {
const editor = await init();
let gutterMarker = editor.getGutterMarker(15, GUTTER_NAME);
const individualColors = $(gutterMarker).find(".color-box");
individualColors[0].click();
await __PR.awaitsFor(()=>{
return __PR.$(".CodeMirror-linewidget").length === 1 &&
areColorsEqual(__PR.$(".CodeMirror-linewidget").find(".original-color")[0], "#ff0090");
}, "quick edit to color #ff0090 appear");
individualColors[2].click();
await __PR.awaitsFor(()=>{
return __PR.$(".CodeMirror-linewidget").length === 1 &&
areColorsEqual(__PR.$(".CodeMirror-linewidget").find(".original-color")[0], "#954e3e");
}, "quick edit to color #954e3e appear");
await __PR.closeFile();
});

// todo test code changes, code changes at end of file
}

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

0 comments on commit f9db349

Please sign in to comment.