chromaui / chromatic-e2e

Archive end-to-end tests to be replayed in Storybook and Chromatic
MIT License
21 stars 4 forks source link

Add a file extension based on Content-Type header for files that have it #27

Closed jwir3 closed 11 months ago

jwir3 commented 11 months ago

Issue: CAP-1204

What Changed

This does three things:

  1. Adds playwright tests for complete "E2E" testing of the test-archiver.
  2. Refactors the mapping of source files to destination files into a class called the SourceMapper, which follows a builder pattern.
  3. Fixes an issue where directories and files can have the same name by making files that are sent with a Content-Type header have a file extension.

How to test

There are two ways:

  1. Run yarn test:playwright and verify everything passes.
  2. Reproduce the steps in https://linear.app/chromaui/issue/CAP-1204/eisdir-illegal-operation-on-a-directory and verify that they pass.

Change Type

📦 Published PR as canary version: 0.0.31--canary.27.3c12abd.0
:sparkles: Test out this PR locally via: ```bash npm install @chromaui/test-archiver@0.0.31--canary.27.3c12abd.0 # or yarn add @chromaui/test-archiver@0.0.31--canary.27.3c12abd.0 ```
linear[bot] commented 11 months ago
CAP-1204 EISDIR: illegal operation on a directory

One specific use case reported in the [original issue](https://github.com/chromaui/test-archiver/issues/14) has been fixed, but this is still possible when it's not the top-level route that causes the conflict. To replicate: * Clone [https://github.com/tevanoff/chromatic-e2e-issues](https://github.com/tevanoff/chromatic-e2e-issues) * Run `yarn playwright test conflict.test.ts` * Then: ``` $ yarn playwright test conflict.test.ts ... Error: EEXIST: file already exists, mkdir ... ``` * Or (depending on which archives first): ``` yarn playwright test conflict.test.ts ... Error: EISDIR: illegal operation on a directory, open ```

thafryer commented 11 months ago

:rocket: PR was released in v0.0.31 :rocket: