From e22acaa56524da3cb83ea8d92a4e89ca79a6da5b Mon Sep 17 00:00:00 2001 From: David Taylor Date: Thu, 7 Apr 2022 14:39:52 +0100 Subject: [PATCH] DEV: Fix flaky `tags-test` (#16410) The test was dependent on a translation string. Under certain seeds, the translation string for `{{category-drop}}`'s `noCategoriesLabel` is broken. This is because the value is calculated the first time a `{{category-drop}}` is rendered during the suite. If that first time happens to be during a test which is messing with `I18n.translations`, then it will cache a broken value. Maybe this should be fixed in a future commit... but for now moving to `data-value` will make the `tags-test` more robust and will stop the flakiness. --- app/assets/javascripts/discourse/tests/acceptance/tags-test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/assets/javascripts/discourse/tests/acceptance/tags-test.js b/app/assets/javascripts/discourse/tests/acceptance/tags-test.js index a5ea8d1959..1d98b43a3f 100644 --- a/app/assets/javascripts/discourse/tests/acceptance/tags-test.js +++ b/app/assets/javascripts/discourse/tests/acceptance/tags-test.js @@ -499,7 +499,7 @@ acceptance("Tag info", function (needs) { await click(".category-breadcrumb li:nth-of-type(2) .category-drop-header"); await click( - '.category-breadcrumb li:nth-of-type(2) .category-row[data-name="none"]' + '.category-breadcrumb li:nth-of-type(2) .category-row[data-value="no-categories"]' ); assert.strictEqual(currentURL(), "/tags/c/feature/2/none/planters"); });