@@ -291,6 +291,38 @@ test('start with an existing disk, but then switch to a silo image', async ({ pa
291291 await expectNotVisible ( page , [ 'text=disk-7' ] )
292292} )
293293
294+ test ( 'additional disks do not list committed disks as available' , async ( { page } ) => {
295+ await page . goto ( '/projects/mock-project/instances-new' )
296+
297+ const attachExistingDiskButton = page . getByRole ( 'button' , {
298+ name : 'Attach existing disk' ,
299+ } )
300+ const selectAnOption = page . getByRole ( 'button' , { name : 'Select an option' } )
301+ const disk2 = page . getByRole ( 'option' , { name : 'disk-2' } )
302+ const disk3 = page . getByRole ( 'option' , { name : 'disk-3' } )
303+ const disk4 = page . getByRole ( 'option' , { name : 'disk-4' } )
304+
305+ await attachExistingDiskButton . click ( )
306+ await selectAnOption . click ( )
307+ // disk-2 is already attached, so should not be visible in the list
308+ await expect ( disk2 ) . toBeHidden ( )
309+ // disk-3, though, should be present
310+ await expect ( disk3 ) . toBeVisible ( )
311+ await expect ( disk4 ) . toBeVisible ( )
312+
313+ // select disk-3 and "attach" it to the instance that will be created
314+ await disk3 . click ( )
315+ await page . getByRole ( 'button' , { name : 'Attach disk' } ) . click ( )
316+
317+ await attachExistingDiskButton . click ( )
318+ await selectAnOption . click ( )
319+ // disk-2 should still be hidden
320+ await expect ( disk2 ) . toBeHidden ( )
321+ // now disk-3 should be hidden as well
322+ await expect ( disk3 ) . toBeHidden ( )
323+ await expect ( disk4 ) . toBeVisible ( )
324+ } )
325+
294326test ( 'maintains selected values even when changing tabs' , async ( { page } ) => {
295327 const instanceName = 'arch-based-instance'
296328 await page . goto ( '/projects/mock-project/instances-new' )
0 commit comments