Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,26 @@
},
"problemMatcher": []
},
{
"label": "Update e2e snapshots (specific file)",
"command": "bash",
"type": "shell",
"args": [
"-c",
"COMPONENT=\"${input:componentName}\"; if [[ \"$COMPONENT\" == *.test.ts ]]; then TEST_FILE=\"$COMPONENT\"; else TEST_FILE=\"e2e/components/$COMPONENT.test.ts\"; fi; if ! docker --version >/dev/null 2>&1; then echo \"Docker is required for this script to run. Install Docker Desktop from https://www.docker.com/products/docker-desktop/\"; exit 1; elif ! docker info >/dev/null 2>&1; then echo \"Docker installed but not running. Starting Docker Desktop...\"; open -a Docker && echo \"Waiting for Docker to start...\" && while ! docker info >/dev/null 2>&1; do sleep 2; done && echo \"Docker is now running\"; fi; ./script/test-e2e \"$TEST_FILE --update-snapshots\""
Copy link

Copilot AI Jul 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This single-line bash command is extremely complex and difficult to read or maintain. Consider breaking it into multiple lines or extracting it to a separate script file that can be called from the task.

Copilot uses AI. Check for mistakes.
Copy link

Copilot AI Jul 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The open -a Docker command is macOS-specific and will fail on Windows or Linux systems. Consider adding platform detection or providing cross-platform alternatives for starting Docker.

Suggested change
"COMPONENT=\"${input:componentName}\"; if [[ \"$COMPONENT\" == *.test.ts ]]; then TEST_FILE=\"$COMPONENT\"; else TEST_FILE=\"e2e/components/$COMPONENT.test.ts\"; fi; if ! docker --version >/dev/null 2>&1; then echo \"Docker is required for this script to run. Install Docker Desktop from https://www.docker.com/products/docker-desktop/\"; exit 1; elif ! docker info >/dev/null 2>&1; then echo \"Docker installed but not running. Starting Docker Desktop...\"; open -a Docker && echo \"Waiting for Docker to start...\" && while ! docker info >/dev/null 2>&1; do sleep 2; done && echo \"Docker is now running\"; fi; ./script/test-e2e \"$TEST_FILE --update-snapshots\""
"COMPONENT=\"${input:componentName}\"; if [[ \"$COMPONENT\" == *.test.ts ]]; then TEST_FILE=\"$COMPONENT\"; else TEST_FILE=\"e2e/components/$COMPONENT.test.ts\"; fi; if ! docker --version >/dev/null 2>&1; then echo \"Docker is required for this script to run. Install Docker Desktop from https://www.docker.com/products/docker-desktop/\"; exit 1; elif ! docker info >/dev/null 2>&1; then echo \"Docker installed but not running. Starting Docker Desktop...\"; case \"$(uname -s)\" in Darwin) open -a Docker ;; Linux) sudo systemctl start docker ;; CYGWIN*|MINGW32*|MSYS*|MINGW*) powershell.exe -Command \"Start-Process 'Docker Desktop' -Verb RunAs\" ;; *) echo \"Unsupported platform. Please start Docker manually.\"; exit 1 ;; esac; echo \"Waiting for Docker to start...\"; while ! docker info >/dev/null 2>&1; do sleep 2; done; echo \"Docker is now running\"; fi; ./script/test-e2e \"$TEST_FILE --update-snapshots\""

Copilot uses AI. Check for mistakes.
],
"group": "test",
"presentation": {
"echo": true,
"reveal": "always",
"focus": false,
"panel": "new"
},
"options": {
"cwd": "${workspaceFolder}"
},
"problemMatcher": []
},
],
"inputs": [
{
Expand Down
6 changes: 3 additions & 3 deletions e2e/components/IconButton.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@ test.describe('IconButton', () => {
}

// Default state
await expect(page).toHaveScreenshot(`IconButton.${story.title}.${theme}.png`, {
animations: 'disabled',
})
expect(await page.screenshot({animations: 'disabled'})).toMatchSnapshot(
`IconButton.${story.title}.${theme}.png`,
)
})
})
}
Expand Down
Loading