diff --git a/spec/spoilers.js b/spec/spoilers.js index 4914205f7..f32c5772d 100644 --- a/spec/spoilers.js +++ b/spec/spoilers.js @@ -153,15 +153,15 @@ describe("A spoiler message", function () { await u.waitUntil(() => message_content.textContent === spoiler); const spoiler_msg_el = view.el.querySelector('.chat-msg__text.spoiler'); - expect(Array.from(spoiler_msg_el.classList).includes('collapsed')).toBeTruthy(); + expect(Array.from(spoiler_msg_el.classList).includes('hidden')).toBeTruthy(); spoiler_toggle = view.el.querySelector('.spoiler-toggle'); expect(spoiler_toggle.textContent.trim()).toBe('Show more'); spoiler_toggle.click(); - await u.waitUntil(() => !Array.from(spoiler_msg_el.classList).includes('collapsed')); + await u.waitUntil(() => !Array.from(spoiler_msg_el.classList).includes('hidden')); expect(spoiler_toggle.textContent.trim()).toBe('Show less'); spoiler_toggle.click(); - await u.waitUntil(() => Array.from(spoiler_msg_el.classList).includes('collapsed')); + await u.waitUntil(() => Array.from(spoiler_msg_el.classList).includes('hidden')); done(); })); @@ -235,15 +235,15 @@ describe("A spoiler message", function () { await u.waitUntil(() => message_content.textContent === spoiler); const spoiler_msg_el = view.el.querySelector('.chat-msg__text.spoiler'); - expect(Array.from(spoiler_msg_el.classList).includes('collapsed')).toBeTruthy(); + expect(Array.from(spoiler_msg_el.classList).includes('hidden')).toBeTruthy(); spoiler_toggle = view.el.querySelector('.spoiler-toggle'); expect(spoiler_toggle.textContent.trim()).toBe('Show more'); spoiler_toggle.click(); - await u.waitUntil(() => !Array.from(spoiler_msg_el.classList).includes('collapsed')); + await u.waitUntil(() => !Array.from(spoiler_msg_el.classList).includes('hidden')); expect(spoiler_toggle.textContent.trim()).toBe('Show less'); spoiler_toggle.click(); - await u.waitUntil(() => Array.from(spoiler_msg_el.classList).includes('collapsed')); + await u.waitUntil(() => Array.from(spoiler_msg_el.classList).includes('hidden')); done(); })); }); diff --git a/src/components/message.js b/src/components/message.js index 189ef0d0d..fdbef4301 100644 --- a/src/components/message.js +++ b/src/components/message.js @@ -223,7 +223,7 @@ export default class Message extends CustomElement { `; - const spoiler_classes = this.is_spoiler ? `spoiler ${this.is_spoiler_visible ? '' : 'collapsed'}` : ''; + const spoiler_classes = this.is_spoiler ? `spoiler ${this.is_spoiler_visible ? '' : 'hidden'}` : ''; return html` ${ this.is_spoiler ? tpl_spoiler_hint : '' } ${ this.subject ? html`
${this.subject}
` : '' }