Skip to content

Commit 3501973

Browse files
committed
test: update tests for copy command
1 parent 2873606 commit 3501973

1 file changed

Lines changed: 4 additions & 23 deletions

File tree

test/e2e/create-command.spec.ts

Lines changed: 4 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ test.describe('Create Command', () => {
6262
})
6363

6464
test.describe('Copy Functionality', () => {
65-
test('hovering create command shows copy button', async ({ page, goto }) => {
65+
test('copy button is always visible', async ({ page, goto }) => {
6666
await goto('/package/vite', { waitUntil: 'hydration' })
6767

6868
await expect(page.locator('h1')).toContainText('vite', { timeout: 15000 })
@@ -75,14 +75,8 @@ test.describe('Create Command', () => {
7575
const createCommandContainer = page.locator('.group\\/createcmd').first()
7676
await expect(createCommandContainer).toBeVisible({ timeout: 20000 })
7777

78-
// Copy button should initially be hidden (opacity-0)
78+
// Copy button should always be visible
7979
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
8680
await expect(copyButton).toHaveCSS('opacity', '1')
8781
})
8882

@@ -104,9 +98,6 @@ test.describe('Create Command', () => {
10498
const createCommandContainer = page.locator('.group\\/createcmd').first()
10599
await expect(createCommandContainer).toBeVisible({ timeout: 20000 })
106100

107-
await createCommandContainer.hover()
108-
109-
// Click the copy button
110101
const copyButton = createCommandContainer.locator('button')
111102
await copyButton.click()
112103

@@ -123,21 +114,15 @@ test.describe('Create Command', () => {
123114
})
124115

125116
test.describe('Install Command Copy', () => {
126-
test('hovering install command shows copy button', async ({ page, goto }) => {
117+
test('copy button is always visible', async ({ page, goto }) => {
127118
await goto('/package/is-odd', { waitUntil: 'hydration' })
128119

129120
// Find the install command container
130121
const installCommandContainer = page.locator('.group\\/installcmd').first()
131122
await expect(installCommandContainer).toBeVisible()
132123

133-
// Copy button should initially be hidden
124+
// Copy button should always be visible
134125
const copyButton = installCommandContainer.locator('button')
135-
await expect(copyButton).toHaveCSS('opacity', '0')
136-
137-
// Hover over the container
138-
await installCommandContainer.hover()
139-
140-
// Copy button should become visible
141126
await expect(copyButton).toHaveCSS('opacity', '1')
142127
})
143128

@@ -151,11 +136,7 @@ test.describe('Create Command', () => {
151136

152137
await goto('/package/is-odd', { waitUntil: 'hydration' })
153138

154-
// Find and hover over the install command container
155139
const installCommandContainer = page.locator('.group\\/installcmd').first()
156-
await installCommandContainer.hover()
157-
158-
// Click the copy button
159140
const copyButton = installCommandContainer.locator('button')
160141
await copyButton.click()
161142

0 commit comments

Comments
 (0)