11/**
2- * Tests for ConnectorModal component.
2+ * Tests for HeaderConnectorModal component.
33 *
44 * Uses the mock connector composable to test various states
55 * without needing an actual HTTP server.
@@ -9,12 +9,12 @@ import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest'
99import { mountSuspended } from '@nuxt/test-utils/runtime'
1010import { ref , computed , readonly , nextTick } from 'vue'
1111import type { VueWrapper } from '@vue/test-utils'
12- import type { MockConnectorTestControls } from '../../../shared/ test-utils'
12+ import type { MockConnectorTestControls } from '../../test-utils'
1313
1414/** Subset of MockConnectorTestControls for unit tests that don't need stateManager */
1515type UnitTestConnectorControls = Omit < MockConnectorTestControls , 'stateManager' >
1616import type { PendingOperation } from '../../../cli/src/types'
17- import { ConnectorModal } from '#components'
17+ import { HeaderConnectorModal } from '#components'
1818
1919// Mock state that will be controlled by tests
2020const mockState = ref ( {
@@ -167,10 +167,10 @@ afterEach(() => {
167167 }
168168} )
169169
170- describe ( 'ConnectorModal ' , ( ) => {
170+ describe ( 'HeaderConnectorModal ' , ( ) => {
171171 describe ( 'Disconnected state' , ( ) => {
172172 it ( 'shows connection form when not connected' , async ( ) => {
173- currentWrapper = await mountSuspended ( ConnectorModal , {
173+ currentWrapper = await mountSuspended ( HeaderConnectorModal , {
174174 props : { open : true } ,
175175 attachTo : document . body ,
176176 } )
@@ -193,7 +193,7 @@ describe('ConnectorModal', () => {
193193 } )
194194
195195 it ( 'shows the CLI command to run' , async ( ) => {
196- currentWrapper = await mountSuspended ( ConnectorModal , {
196+ currentWrapper = await mountSuspended ( HeaderConnectorModal , {
197197 props : { open : true } ,
198198 attachTo : document . body ,
199199 } )
@@ -204,7 +204,7 @@ describe('ConnectorModal', () => {
204204 } )
205205
206206 it ( 'can copy command to clipboard' , async ( ) => {
207- currentWrapper = await mountSuspended ( ConnectorModal , {
207+ currentWrapper = await mountSuspended ( HeaderConnectorModal , {
208208 props : { open : true } ,
209209 attachTo : document . body ,
210210 } )
@@ -223,7 +223,7 @@ describe('ConnectorModal', () => {
223223 } )
224224
225225 it ( 'disables connect button when token is empty' , async ( ) => {
226- currentWrapper = await mountSuspended ( ConnectorModal , {
226+ currentWrapper = await mountSuspended ( HeaderConnectorModal , {
227227 props : { open : true } ,
228228 attachTo : document . body ,
229229 } )
@@ -235,7 +235,7 @@ describe('ConnectorModal', () => {
235235 } )
236236
237237 it ( 'enables connect button when token is entered' , async ( ) => {
238- currentWrapper = await mountSuspended ( ConnectorModal , {
238+ currentWrapper = await mountSuspended ( HeaderConnectorModal , {
239239 props : { open : true } ,
240240 attachTo : document . body ,
241241 } )
@@ -258,7 +258,7 @@ describe('ConnectorModal', () => {
258258 // Simulate an error before mounting
259259 mockControls . simulateError ( 'Could not reach connector. Is it running?' )
260260
261- currentWrapper = await mountSuspended ( ConnectorModal , {
261+ currentWrapper = await mountSuspended ( HeaderConnectorModal , {
262262 props : { open : true } ,
263263 attachTo : document . body ,
264264 } )
@@ -281,7 +281,7 @@ describe('ConnectorModal', () => {
281281 } )
282282
283283 it ( 'shows connected status' , async ( ) => {
284- currentWrapper = await mountSuspended ( ConnectorModal , {
284+ currentWrapper = await mountSuspended ( HeaderConnectorModal , {
285285 props : { open : true } ,
286286 attachTo : document . body ,
287287 } )
@@ -292,7 +292,7 @@ describe('ConnectorModal', () => {
292292 } )
293293
294294 it ( 'shows logged in username' , async ( ) => {
295- currentWrapper = await mountSuspended ( ConnectorModal , {
295+ currentWrapper = await mountSuspended ( HeaderConnectorModal , {
296296 props : { open : true } ,
297297 attachTo : document . body ,
298298 } )
@@ -303,7 +303,7 @@ describe('ConnectorModal', () => {
303303 } )
304304
305305 it ( 'shows disconnect button' , async ( ) => {
306- currentWrapper = await mountSuspended ( ConnectorModal , {
306+ currentWrapper = await mountSuspended ( HeaderConnectorModal , {
307307 props : { open : true } ,
308308 attachTo : document . body ,
309309 } )
@@ -318,7 +318,7 @@ describe('ConnectorModal', () => {
318318 } )
319319
320320 it ( 'hides connection form when connected' , async ( ) => {
321- currentWrapper = await mountSuspended ( ConnectorModal , {
321+ currentWrapper = await mountSuspended ( HeaderConnectorModal , {
322322 props : { open : true } ,
323323 attachTo : document . body ,
324324 } )
@@ -333,7 +333,7 @@ describe('ConnectorModal', () => {
333333
334334 describe ( 'Modal behavior' , ( ) => {
335335 it ( 'closes modal when close button is clicked' , async ( ) => {
336- currentWrapper = await mountSuspended ( ConnectorModal , {
336+ currentWrapper = await mountSuspended ( HeaderConnectorModal , {
337337 props : { open : true } ,
338338 attachTo : document . body ,
339339 } )
@@ -354,7 +354,7 @@ describe('ConnectorModal', () => {
354354 } )
355355
356356 it ( 'closes modal when backdrop is clicked' , async ( ) => {
357- currentWrapper = await mountSuspended ( ConnectorModal , {
357+ currentWrapper = await mountSuspended ( HeaderConnectorModal , {
358358 props : { open : true } ,
359359 attachTo : document . body ,
360360 } )
@@ -376,7 +376,7 @@ describe('ConnectorModal', () => {
376376 } )
377377
378378 it ( 'does not render dialog when open is false' , async ( ) => {
379- currentWrapper = await mountSuspended ( ConnectorModal , {
379+ currentWrapper = await mountSuspended ( HeaderConnectorModal , {
380380 props : { open : false } ,
381381 attachTo : document . body ,
382382 } )
0 commit comments