Skip to content

Conversation

@langermank
Copy link
Contributor

Add a task to update snaps + try old format in IconButton

@langermank langermank added the skip changeset This change does not need a changelog label Jul 24, 2025
Copilot AI review requested due to automatic review settings July 24, 2025 16:35
@langermank langermank requested a review from a team as a code owner July 24, 2025 16:35
@langermank langermank requested a review from joshblack July 24, 2025 16:35
@changeset-bot
Copy link

changeset-bot bot commented Jul 24, 2025

⚠️ No Changeset found

Latest commit: 0d72533

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds a VS Code task for updating e2e snapshots and modifies the IconButton test to use an older snapshot format. The changes aim to improve developer workflow by providing a convenient way to update test snapshots through VS Code's task runner.

  • Adds a new VS Code task that allows developers to update e2e snapshots for specific components
  • Changes IconButton test from toHaveScreenshot to toMatchSnapshot approach
  • Includes Docker availability checks in the new task

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
.vscode/tasks.json Adds new task for updating e2e snapshots with Docker checks and component name input
e2e/components/IconButton.test.ts Changes screenshot assertion method from toHaveScreenshot to toMatchSnapshot

"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.
"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.

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.
@langermank langermank enabled auto-merge July 24, 2025 16:38
@github-actions
Copy link
Contributor

size-limit report 📦

Path Size
packages/react/dist/browser.esm.js 92.21 KB (0%)
packages/react/dist/browser.umd.js 92.39 KB (0%)

@joshblack joshblack disabled auto-merge July 24, 2025 22:00
@joshblack joshblack merged commit 1539e32 into main Jul 24, 2025
50 checks passed
@joshblack joshblack deleted the add-update-snapshots-task branch July 24, 2025 22:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip changeset This change does not need a changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants