From 55fa94f75901fc95ac28e2fea8cc3813ab2750ab Mon Sep 17 00:00:00 2001 From: Alan Guo Xiang Tan Date: Wed, 10 Aug 2022 21:22:55 +0800 Subject: [PATCH] DEV: Attempt to fix flaky sidebar test (#17852) Makes displaying and hiding the list more deterministic. ``` Error: QUnit Test Failure: Exam Partition 1 - Acceptance: Sidebar - Community Section: clicking on more... link not ok 491 Firefox 91.0 - [722 ms] - Exam Partition 1 - Acceptance: Sidebar - Community Section: clicking on more... link --- actual: > true expected: > false stack: > @http://localhost:7357/assets/core-tests.js:9826:14 message: > additional section links are hidden negative: > false browser log: | ``` --- .../discourse/app/components/sidebar/more-section-links.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/discourse/app/components/sidebar/more-section-links.js b/app/assets/javascripts/discourse/app/components/sidebar/more-section-links.js index d339ad6edfd..3e54ee34d20 100644 --- a/app/assets/javascripts/discourse/app/components/sidebar/more-section-links.js +++ b/app/assets/javascripts/discourse/app/components/sidebar/more-section-links.js @@ -72,8 +72,8 @@ export default class SidebarMoreSectionLinks extends GlimmerComponent { } @action - toggleSectionLinks() { - this.shouldDisplaySectionLinks = !this.shouldDisplaySectionLinks; + toggleSectionLinks(element) { + this.shouldDisplaySectionLinks = element.target.hasAttribute("open"); } #removeClickEventListener() {