From 53f501e1a77c822725be664464c0fdbb4b8adacb Mon Sep 17 00:00:00 2001 From: Eli Bosley Date: Wed, 3 Sep 2025 17:31:52 -0400 Subject: [PATCH] refactor: update test for hidden element mounting in vue-mount-app - Renamed test case to clarify that the component should mount even when the element is hidden. - Adjusted assertions to ensure that hidden elements can still mount successfully without triggering warnings. This change enhances the clarity and reliability of the test suite for the vue-mount-app component. --- web/__test__/components/Wrapper/vue-mount-app.test.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/web/__test__/components/Wrapper/vue-mount-app.test.ts b/web/__test__/components/Wrapper/vue-mount-app.test.ts index 8ad5675fe..132a64043 100644 --- a/web/__test__/components/Wrapper/vue-mount-app.test.ts +++ b/web/__test__/components/Wrapper/vue-mount-app.test.ts @@ -649,7 +649,7 @@ describe('vue-mount-app', () => { expect(element.querySelector('.test-component')).toBeTruthy(); }); - it('should validate element visibility before mounting', async () => { + it('should mount even when element is hidden', async () => { const element = document.createElement('div'); element.id = 'hidden-app'; element.style.display = 'none'; @@ -658,7 +658,9 @@ describe('vue-mount-app', () => { autoMountComponent(TestComponent, '#hidden-app'); await vi.runAllTimersAsync(); - expect(consoleWarnSpy).toHaveBeenCalledWith( + // Hidden elements should still mount successfully + expect(element.querySelector('.test-component')).toBeTruthy(); + expect(consoleWarnSpy).not.toHaveBeenCalledWith( expect.stringContaining('No valid DOM elements found') ); });