@@ -61,67 +61,6 @@ test.describe('Create Command', () => {
6161 } )
6262 } )
6363
64- test . describe ( 'Copy Functionality' , ( ) => {
65- test ( 'hovering create command shows copy button' , async ( { page, goto } ) => {
66- await goto ( '/package/vite' , { waitUntil : 'hydration' } )
67-
68- await expect ( page . locator ( 'h1' ) ) . toContainText ( 'vite' , { timeout : 15000 } )
69-
70- await expect ( page . locator ( 'main header' ) . locator ( 'text=/v\\d+\\.\\d+/' ) ) . toBeVisible ( {
71- timeout : 15000 ,
72- } )
73-
74- // Find the create command container (wait longer for API response)
75- const createCommandContainer = page . locator ( '.group\\/createcmd' ) . first ( )
76- await expect ( createCommandContainer ) . toBeVisible ( { timeout : 20000 } )
77-
78- // Copy button should initially be hidden (opacity-0)
79- const copyButton = createCommandContainer . locator ( 'button' )
80- await expect ( copyButton ) . toHaveCSS ( 'opacity' , '0' )
81-
82- // Hover over the container
83- await createCommandContainer . hover ( )
84-
85- // Copy button should become visible
86- await expect ( copyButton ) . toHaveCSS ( 'opacity' , '1' )
87- } )
88-
89- test ( 'clicking copy button copies create command and shows confirmation' , async ( {
90- page,
91- goto,
92- context,
93- } ) => {
94- // Grant clipboard permissions
95- await context . grantPermissions ( [ 'clipboard-read' , 'clipboard-write' ] )
96-
97- await goto ( '/package/vite' , { waitUntil : 'hydration' } )
98- await expect ( page . locator ( 'h1' ) ) . toContainText ( 'vite' , { timeout : 15000 } )
99-
100- await expect ( page . locator ( 'main header' ) . locator ( 'text=/v\\d+\\.\\d+/' ) ) . toBeVisible ( {
101- timeout : 15000 ,
102- } )
103-
104- const createCommandContainer = page . locator ( '.group\\/createcmd' ) . first ( )
105- await expect ( createCommandContainer ) . toBeVisible ( { timeout : 20000 } )
106-
107- await createCommandContainer . hover ( )
108-
109- // Click the copy button
110- const copyButton = createCommandContainer . locator ( 'button' )
111- await copyButton . click ( )
112-
113- // Button text should change to "copied!"
114- await expect ( copyButton ) . toContainText ( / c o p i e d / i)
115-
116- // Verify clipboard content contains the create command
117- const clipboardContent = await page . evaluate ( ( ) => navigator . clipboard . readText ( ) )
118- expect ( clipboardContent ) . toMatch ( / c r e a t e v i t e / i)
119-
120- await expect ( copyButton ) . toContainText ( / c o p y / i, { timeout : 5000 } )
121- await expect ( copyButton ) . not . toContainText ( / c o p i e d / i)
122- } )
123- } )
124-
12564 test . describe ( 'Install Command Copy' , ( ) => {
12665 test ( 'hovering install command shows copy button' , async ( { page, goto } ) => {
12766 await goto ( '/package/is-odd' , { waitUntil : 'hydration' } )
0 commit comments