DEV: skip tests instead of commenting them (#7774)

This commit is contained in:
Joffrey JAFFEUX
2019-06-17 10:24:20 +02:00
committed by GitHub
parent 102be5a9e3
commit 59e84e8e05
3 changed files with 246 additions and 241 deletions

View File

@ -1,164 +1,164 @@
// import { acceptance } from "helpers/qunit-helpers"; import { acceptance } from "helpers/qunit-helpers";
// import { IMAGE_VERSION as v } from "pretty-text/emoji/version"; import { IMAGE_VERSION as v } from "pretty-text/emoji/version";
// import { resetCache } from "discourse/components/emoji-picker"; import { resetCache } from "discourse/components/emoji-picker";
//
// acceptance("EmojiPicker", { acceptance("EmojiPicker", {
// loggedIn: true, loggedIn: true,
// beforeEach() { beforeEach() {
// resetCache(); resetCache();
// } }
// }); });
//
// QUnit.test("emoji picker can be opened/closed", async assert => { QUnit.skip("emoji picker can be opened/closed", async assert => {
// await visit("/t/internationalization-localization/280"); await visit("/t/internationalization-localization/280");
// await click("#topic-footer-buttons .btn.create"); await click("#topic-footer-buttons .btn.create");
//
// await click("button.emoji.btn"); await click("button.emoji.btn");
// assert.notEqual( assert.notEqual(
// find(".emoji-picker") find(".emoji-picker")
// .html() .html()
// .trim(), .trim(),
// "", "",
// "it opens the picker" "it opens the picker"
// ); );
//
// await click("button.emoji.btn"); await click("button.emoji.btn");
// assert.equal( assert.equal(
// find(".emoji-picker") find(".emoji-picker")
// .html() .html()
// .trim(), .trim(),
// "", "",
// "it closes the picker" "it closes the picker"
// ); );
// }); });
//
// QUnit.test("emojis can be hovered to display info", async assert => { QUnit.skip("emojis can be hovered to display info", async assert => {
// await visit("/t/internationalization-localization/280"); await visit("/t/internationalization-localization/280");
// await click("#topic-footer-buttons .btn.create"); await click("#topic-footer-buttons .btn.create");
//
// await click("button.emoji.btn"); await click("button.emoji.btn");
// $(".emoji-picker button[title='grinning']").trigger("mouseover"); $(".emoji-picker button[title='grinning']").trigger("mouseover");
// assert.equal( assert.equal(
// find(".emoji-picker .info") find(".emoji-picker .info")
// .html() .html()
// .trim(), .trim(),
// `<img src=\"/images/emoji/emoji_one/grinning.png?v=${v}\" class=\"emoji\"> <span>:grinning:<span></span></span>`, `<img src=\"/images/emoji/emoji_one/grinning.png?v=${v}\" class=\"emoji\"> <span>:grinning:<span></span></span>`,
// "it displays emoji info when hovering emoji" "it displays emoji info when hovering emoji"
// ); );
// }); });
//
// QUnit.test("emoji picker triggers event when picking emoji", async assert => { QUnit.skip("emoji picker triggers event when picking emoji", async assert => {
// await visit("/t/internationalization-localization/280"); await visit("/t/internationalization-localization/280");
// await click("#topic-footer-buttons .btn.create"); await click("#topic-footer-buttons .btn.create");
// await click("button.emoji.btn"); await click("button.emoji.btn");
//
// await click(".emoji-picker button[title='grinning']"); await click(".emoji-picker button[title='grinning']");
// assert.equal( assert.equal(
// find(".d-editor-input").val(), find(".d-editor-input").val(),
// ":grinning:", ":grinning:",
// "it adds the emoji code in the editor when selected" "it adds the emoji code in the editor when selected"
// ); );
// }); });
//
// QUnit.test("emoji picker has a list of recently used emojis", async assert => { QUnit.skip("emoji picker has a list of recently used emojis", async assert => {
// await visit("/t/internationalization-localization/280"); await visit("/t/internationalization-localization/280");
// await click("#topic-footer-buttons .btn.create"); await click("#topic-footer-buttons .btn.create");
// await click("button.emoji.btn"); await click("button.emoji.btn");
//
// await click( await click(
// ".emoji-picker .section[data-section='smileys_&_emotion'] button.emoji[title='grinning']" ".emoji-picker .section[data-section='smileys_&_emotion'] button.emoji[title='grinning']"
// ); );
// assert.equal( assert.equal(
// find('.emoji-picker .section[data-section="recent"]').css("display"), find('.emoji-picker .section[data-section="recent"]').css("display"),
// "block", "block",
// "it shows recent section" "it shows recent section"
// ); );
//
// assert.equal( assert.equal(
// find( find(
// '.emoji-picker .section[data-section="recent"] .section-group button.emoji' '.emoji-picker .section[data-section="recent"] .section-group button.emoji'
// ).length, ).length,
// 1, 1,
// "it adds the emoji code to the recently used emojis list" "it adds the emoji code to the recently used emojis list"
// ); );
//
// await click(".emoji-picker .clear-recent"); await click(".emoji-picker .clear-recent");
// assert.equal( assert.equal(
// find( find(
// '.emoji-picker .section[data-section="recent"] .section-group button.emoji' '.emoji-picker .section[data-section="recent"] .section-group button.emoji'
// ).length, ).length,
// 0, 0,
// "it has cleared recent emojis" "it has cleared recent emojis"
// ); );
//
// assert.equal( assert.equal(
// find('.emoji-picker .section[data-section="recent"]').css("display"), find('.emoji-picker .section[data-section="recent"]').css("display"),
// "none", "none",
// "it hides recent section" "it hides recent section"
// ); );
//
// assert.equal( assert.equal(
// find('.emoji-picker .category-icon button.emoji[data-section="recent"]') find('.emoji-picker .category-icon button.emoji[data-section="recent"]')
// .parent() .parent()
// .css("display"), .css("display"),
// "none", "none",
// "it hides recent category icon" "it hides recent category icon"
// ); );
// }); });
//
// QUnit.test( QUnit.skip(
// "emoji picker correctly orders recently used emojis", "emoji picker correctly orders recently used emojis",
// async assert => { async assert => {
// await visit("/t/internationalization-localization/280"); await visit("/t/internationalization-localization/280");
// await click("#topic-footer-buttons .btn.create"); await click("#topic-footer-buttons .btn.create");
//
// await click("button.emoji.btn"); await click("button.emoji.btn");
// await click(".emoji-picker button[title='sunglasses']"); await click(".emoji-picker button[title='sunglasses']");
// await click(".emoji-picker button[title='grinning']"); await click(".emoji-picker button[title='grinning']");
// assert.equal( assert.equal(
// find('.section[data-section="recent"] .section-group button.emoji') find('.section[data-section="recent"] .section-group button.emoji')
// .length, .length,
// 2, 2,
// "it has multiple recent emojis" "it has multiple recent emojis"
// ); );
//
// assert.equal( assert.equal(
// /grinning/.test( /grinning/.test(
// find('.section[data-section="recent"] .section-group button.emoji') find('.section[data-section="recent"] .section-group button.emoji')
// .first() .first()
// .css("background-image") .css("background-image")
// ), ),
// true, true,
// "it puts the last used emoji in first" "it puts the last used emoji in first"
// ); );
// } }
// ); );
//
// QUnit.test("emoji picker lazy loads emojis", async assert => { QUnit.skip("emoji picker lazy loads emojis", async assert => {
// await visit("/t/internationalization-localization/280"); await visit("/t/internationalization-localization/280");
// await click("#topic-footer-buttons .btn.create"); await click("#topic-footer-buttons .btn.create");
//
// await click("button.emoji.btn"); await click("button.emoji.btn");
//
// assert.equal( assert.equal(
// find('.emoji-picker button[title="massage_woman"]').css("background-image"), find('.emoji-picker button[title="massage_woman"]').css("background-image"),
// "none", "none",
// "it doesn't load invisible emojis" "it doesn't load invisible emojis"
// ); );
// }); });
//
// QUnit.test("emoji picker persists state", async assert => { QUnit.skip("emoji picker persists state", async assert => {
// await visit("/t/internationalization-localization/280"); await visit("/t/internationalization-localization/280");
// await click("#topic-footer-buttons .btn.create"); await click("#topic-footer-buttons .btn.create");
//
// await click("button.emoji.btn"); await click("button.emoji.btn");
// await click(".emoji-picker a.diversity-scale.medium-dark"); await click(".emoji-picker a.diversity-scale.medium-dark");
// await click("button.emoji.btn"); await click("button.emoji.btn");
//
// await click("button.emoji.btn"); await click("button.emoji.btn");
// assert.equal( assert.equal(
// find(".emoji-picker .diversity-scale.medium-dark").hasClass("selected"), find(".emoji-picker .diversity-scale.medium-dark").hasClass("selected"),
// true, true,
// "it stores diversity scale" "it stores diversity scale"
// ); );
// }); });

View File

@ -1,50 +1,54 @@
// import componentTest from "helpers/component-test"; import componentTest from "helpers/component-test";
//
// moduleForComponent("ace-editor", { integration: true }); moduleForComponent("ace-editor", { integration: true });
//
// componentTest("css editor", { componentTest("css editor", {
// template: '{{ace-editor mode="css"}}', skip: true,
// test(assert) { template: '{{ace-editor mode="css"}}',
// assert.expect(1); test(assert) {
// assert.ok(find(".ace_editor").length, "it renders the ace editor"); assert.expect(1);
// } assert.ok(find(".ace_editor").length, "it renders the ace editor");
// }); }
// });
// componentTest("html editor", {
// template: '{{ace-editor mode="html" content="<b>wat</b>"}}', componentTest("html editor", {
// test(assert) { skip: true,
// assert.expect(1); template: '{{ace-editor mode="html" content="<b>wat</b>"}}',
// assert.ok(find(".ace_editor").length, "it renders the ace editor"); test(assert) {
// } assert.expect(1);
// }); assert.ok(find(".ace_editor").length, "it renders the ace editor");
// }
// componentTest("sql editor", { });
// template: '{{ace-editor mode="sql" content="SELECT * FROM users"}}',
// test(assert) { componentTest("sql editor", {
// assert.expect(1); skip: true,
// assert.ok(find(".ace_editor").length, "it renders the ace editor"); template: '{{ace-editor mode="sql" content="SELECT * FROM users"}}',
// } test(assert) {
// }); assert.expect(1);
// assert.ok(find(".ace_editor").length, "it renders the ace editor");
// componentTest("disabled editor", { }
// template: });
// '{{ace-editor mode="sql" content="SELECT * FROM users" disabled=true}}',
// test(assert) { componentTest("disabled editor", {
// const $ace = find(".ace_editor"); skip: true,
// assert.expect(3); template:
// assert.ok($ace.length, "it renders the ace editor"); '{{ace-editor mode="sql" content="SELECT * FROM users" disabled=true}}',
// assert.equal( test(assert) {
// $ace const $ace = find(".ace_editor");
// .parent() assert.expect(3);
// .data() assert.ok($ace.length, "it renders the ace editor");
// .editor.getReadOnly(), assert.equal(
// true, $ace
// "it sets ACE to read-only mode" .parent()
// ); .data()
// assert.equal( .editor.getReadOnly(),
// $ace.parent().attr("data-disabled"), true,
// "true", "it sets ACE to read-only mode"
// "ACE wrapper has `data-disabled` attribute set to true" );
// ); assert.equal(
// } $ace.parent().attr("data-disabled"),
// }); "true",
"ACE wrapper has `data-disabled` attribute set to true"
);
}
});

View File

@ -1,5 +1,5 @@
import componentTest from "helpers/component-test"; import componentTest from "helpers/component-test";
// import { withPluginApi } from "discourse/lib/plugin-api"; import { withPluginApi } from "discourse/lib/plugin-api";
import formatTextWithSelection from "helpers/d-editor-helper"; import formatTextWithSelection from "helpers/d-editor-helper";
import { import {
setTextareaSelection, setTextareaSelection,
@ -672,32 +672,33 @@ testCase(`doesn't jump to bottom with long text`, async function(
assert.equal($(textarea).scrollTop(), 0, "it stays scrolled up"); assert.equal($(textarea).scrollTop(), 0, "it stays scrolled up");
}); });
// componentTest("emoji", { componentTest("emoji", {
// template: "{{d-editor value=value}}", skip: true,
// beforeEach() { template: "{{d-editor value=value}}",
// // Test adding a custom button beforeEach() {
// withPluginApi("0.1", api => { // Test adding a custom button
// api.onToolbarCreate(toolbar => { withPluginApi("0.1", api => {
// toolbar.addButton({ api.onToolbarCreate(toolbar => {
// id: "emoji", toolbar.addButton({
// group: "extras", id: "emoji",
// icon: "far-smile", group: "extras",
// action: () => toolbar.context.send("emoji") icon: "far-smile",
// }); action: () => toolbar.context.send("emoji")
// }); });
// }); });
// this.set("value", "hello world."); });
// }, this.set("value", "hello world.");
// async test(assert) { },
// jumpEnd(find("textarea.d-editor-input")[0]); async test(assert) {
// await click("button.emoji"); jumpEnd(find("textarea.d-editor-input")[0]);
// await click("button.emoji");
// await click(
// '.emoji-picker .section[data-section="smileys_&_emotion"] button.emoji[title="grinning"]' await click(
// ); '.emoji-picker .section[data-section="smileys_&_emotion"] button.emoji[title="grinning"]'
// assert.equal(this.value, "hello world.:grinning:"); );
// } assert.equal(this.value, "hello world.:grinning:");
// }); }
});
testCase("replace-text event by default", async function(assert) { testCase("replace-text event by default", async function(assert) {
this.set("value", "red green blue"); this.set("value", "red green blue");