From 83043bd453e673eb80a14a296f5a4a52f3dab235 Mon Sep 17 00:00:00 2001 From: Jarek Radosz Date: Thu, 27 Jul 2023 04:56:50 +0200 Subject: [PATCH] DEV: Enable some of the skipped Firefox tests (#22800) --- .../discourse/tests/acceptance/topic-test.js | 110 ++++++++---------- .../integration/components/d-editor-test.js | 3 +- .../integration/components/input-size-test.js | 42 +++---- 3 files changed, 68 insertions(+), 87 deletions(-) diff --git a/app/assets/javascripts/discourse/tests/acceptance/topic-test.js b/app/assets/javascripts/discourse/tests/acceptance/topic-test.js index 45a40f095d06b..318460d635b0d 100644 --- a/app/assets/javascripts/discourse/tests/acceptance/topic-test.js +++ b/app/assets/javascripts/discourse/tests/acceptance/topic-test.js @@ -1,6 +1,5 @@ import { acceptance, - chromeTest, count, exists, publishToMessageBus, @@ -376,67 +375,54 @@ acceptance("Topic featured links", function (needs) { assert.ok(!exists(".gap"), "it hides gap"); }); - chromeTest( - "Quoting a quote keeps the original poster name", - async function (assert) { - await visit("/t/internationalization-localization/280"); - await selectText("#post_5 blockquote"); - await click(".quote-button .insert-quote"); - - assert.ok( - query(".d-editor-input").value.includes( - 'quote="codinghorror said, post:3, topic:280"' - ) - ); - } - ); - - chromeTest( - "Quoting a quote of a different topic keeps the original topic title", - async function (assert) { - await visit("/t/internationalization-localization/280"); - await selectText("#post_9 blockquote"); - await click(".quote-button .insert-quote"); - - assert.ok( - query(".d-editor-input").value.includes( - 'quote="A new topic with a link to another topic, post:3, topic:62"' - ) - ); - } - ); - - chromeTest( - "Quoting a quote with the Reply button keeps the original poster name", - async function (assert) { - await visit("/t/internationalization-localization/280"); - await selectText("#post_5 blockquote"); - await click(".reply"); - - assert.ok( - query(".d-editor-input").value.includes( - 'quote="codinghorror said, post:3, topic:280"' - ) - ); - } - ); - - // Using J/K on Firefox clean the text selection, so this won't work there - chromeTest( - "Quoting a quote with replyAsNewTopic keeps the original poster name", - async function (assert) { - await visit("/t/internationalization-localization/280"); - await selectText("#post_5 blockquote"); - await triggerKeyEvent(document, "keypress", "J"); - await triggerKeyEvent(document, "keypress", "T"); - - assert.ok( - query(".d-editor-input").value.includes( - 'quote="codinghorror said, post:3, topic:280"' - ) - ); - } - ); + test("Quoting a quote keeps the original poster name", async function (assert) { + await visit("/t/internationalization-localization/280"); + await selectText("#post_5 blockquote"); + await click(".quote-button .insert-quote"); + + assert.ok( + query(".d-editor-input").value.includes( + 'quote="codinghorror said, post:3, topic:280"' + ) + ); + }); + + test("Quoting a quote of a different topic keeps the original topic title", async function (assert) { + await visit("/t/internationalization-localization/280"); + await selectText("#post_9 blockquote"); + await click(".quote-button .insert-quote"); + + assert.ok( + query(".d-editor-input").value.includes( + 'quote="A new topic with a link to another topic, post:3, topic:62"' + ) + ); + }); + + test("Quoting a quote with the Reply button keeps the original poster name", async function (assert) { + await visit("/t/internationalization-localization/280"); + await selectText("#post_5 blockquote"); + await click(".reply"); + + assert.ok( + query(".d-editor-input").value.includes( + 'quote="codinghorror said, post:3, topic:280"' + ) + ); + }); + + test("Quoting a quote with replyAsNewTopic keeps the original poster name", async function (assert) { + await visit("/t/internationalization-localization/280"); + await selectText("#post_5 blockquote"); + await triggerKeyEvent(document, "keypress", "J"); + await triggerKeyEvent(document, "keypress", "T"); + + assert.ok( + query(".d-editor-input").value.includes( + 'quote="codinghorror said, post:3, topic:280"' + ) + ); + }); test("Quoting by selecting text can mark the quote as full", async function (assert) { await visit("/t/internationalization-localization/280"); diff --git a/app/assets/javascripts/discourse/tests/integration/components/d-editor-test.js b/app/assets/javascripts/discourse/tests/integration/components/d-editor-test.js index c5bfaa81b71b2..8d46a09206b60 100644 --- a/app/assets/javascripts/discourse/tests/integration/components/d-editor-test.js +++ b/app/assets/javascripts/discourse/tests/integration/components/d-editor-test.js @@ -2,7 +2,6 @@ import { module, test } from "qunit"; import { setupRenderingTest } from "discourse/tests/helpers/component-test"; import { click, fillIn, render, settled } from "@ember/test-helpers"; import { - chromeTest, exists, paste, query, @@ -71,7 +70,7 @@ module("Integration | Component | d-editor", function (hooks) { } function testCase(title, testFunc) { - chromeTest(title, async function (assert) { + test(title, async function (assert) { this.set("value", "hello world."); await render(hbs``); diff --git a/app/assets/javascripts/discourse/tests/integration/components/input-size-test.js b/app/assets/javascripts/discourse/tests/integration/components/input-size-test.js index a1d8049056bf0..bf24a842ddb32 100644 --- a/app/assets/javascripts/discourse/tests/integration/components/input-size-test.js +++ b/app/assets/javascripts/discourse/tests/integration/components/input-size-test.js @@ -1,7 +1,7 @@ -import { module } from "qunit"; +import { module, test } from "qunit"; import { setupRenderingTest } from "discourse/tests/helpers/component-test"; import { render } from "@ember/test-helpers"; -import { chromeTest, query } from "discourse/tests/helpers/qunit-helpers"; +import { query } from "discourse/tests/helpers/qunit-helpers"; import { hbs } from "ember-cli-htmlbars"; module( @@ -9,28 +9,24 @@ module( function (hooks) { setupRenderingTest(hooks); - // these tests fail on Firefox 78 in CI, skipping for now - chromeTest( - "icon only button, icon and text button, text only button", - async function (assert) { - await render( - hbs` ` - ); + test("icon only button, icon and text button, text only button", async function (assert) { + await render( + hbs` ` + ); - assert.strictEqual( - query(".btn:nth-child(1)").offsetHeight, - query(".btn:nth-child(2)").offsetHeight, - "have equal height" - ); - assert.strictEqual( - query(".btn:nth-child(1)").offsetHeight, - query(".btn:nth-child(3)").offsetHeight, - "have equal height" - ); - } - ); + assert.strictEqual( + query(".btn:nth-child(1)").offsetHeight, + query(".btn:nth-child(2)").offsetHeight, + "have equal height" + ); + assert.strictEqual( + query(".btn:nth-child(1)").offsetHeight, + query(".btn:nth-child(3)").offsetHeight, + "have equal height" + ); + }); - chromeTest("button + text input", async function (assert) { + test("button + text input", async function (assert) { await render( hbs` ` ); @@ -42,7 +38,7 @@ module( ); }); - chromeTest("combo box + input", async function (assert) { + test("combo box + input", async function (assert) { await render( hbs` ` );