Skip to content

Commit 9a76b71

Browse files
authored
Merge pull request #218 from otto-de/B2BDS-182
B2BDS-182 Migrate to Storybook 7
2 parents 787fdd1 + 45f263b commit 9a76b71

File tree

198 files changed

+27894
-39503
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

198 files changed

+27894
-39503
lines changed

.dockerignore

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
.DS_Store
2+
Thumbs.db
3+
node_modules/
4+
**/dist/
5+
**/build/
6+
7+
# VS-CODE
8+
.vscode/*
9+
!.vscode/settings.json
10+
!.vscode/tasks.json
11+
!.vscode/launch.json
12+
!.vscode/extensions.json
13+
!.vscode/*.code-snippets
14+
15+
# Local History for Visual Studio Code
16+
.history/
17+
18+
# Built Visual Studio Code Extensions
19+
*.vsix
20+
21+
#JETBRAINS
22+
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
23+
# Authomatically ignores what it needs to ignore
24+
/.idea/

.vscode/settings.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"files.eol": "\n"
3+
}

DEV-GUIDELINES.md

+4-22
Original file line numberDiff line numberDiff line change
@@ -189,30 +189,12 @@ To be able to capture accurate and consistent renders of our components we need
189189

190190
If you are able to use [Docker Desktop](https://docs.docker.com/desktop/) you can use this tool, otherwise for Mac users [Colima](https://github.com/abiosoft/colima) is a good alternative.
191191

192-
Once you have one of this two runtime envs, you can follow this steps:
192+
Once you have one of this two runtime envs, you can follow these steps:
193193

194-
You will need to have storybook running on your host machine:
195-
```shell
196-
cd packages/core-components
197-
npm run storybook
198-
# storybook runs on localhost:6006
199-
```
200-
201-
Now, you can either use the following shell shortcuts, or run the docker commands directly (you can find the commands in the `do` file):
202-
```shell
203-
# shell shortcuts
204-
./do build-test-image
205-
./do visual-tests
206-
```
194+
1. Run `docker-compose up` or `docker-compose up --build` if you have created the services before. This creates a storybook service
195+
and a service that runs the tests against storybook. If any test failed, you will find a new folder inside `__snapshots__` called `__diff_output__`.
196+
2. If the differences were expected (because you made visual changes to an existing component), run `docker-compose run run-tests npx test-storybook --verbose --url http://storybook:6006 -u`
207197

208-
If you're using windows, make sure that you exchange the `$(pwd)` in the docker commands for Windows equivalent `${pwd}`, otherwise the tests cannot run.
209-
210-
If any test failed, you will find a new folder inside `__snapshots__` called `__diff_output__`.
211-
212-
If the differences where expected run:
213-
```shell
214-
./do visual-tests-update
215-
```
216198

217199
#### Making changes to the docker image
218200

do

-46
This file was deleted.

docker-compose.yml

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
version: '3.8'
2+
3+
services:
4+
storybook:
5+
healthcheck:
6+
test: ["CMD", "curl", "-f", "http://localhost:6006"]
7+
interval: 5s
8+
timeout: 20s
9+
retries: 5
10+
build:
11+
context: .
12+
dockerfile: test.Dockerfile
13+
ports:
14+
- "6006:6006"
15+
command: npm run storybook -- -h 0.0.0.0
16+
working_dir: /b2b/packages/core-components
17+
volumes:
18+
- ./packages/core-components/__snapshots__:/b2b/packages/core-components/__snapshots__
19+
20+
run-tests:
21+
build:
22+
context: .
23+
dockerfile: test.Dockerfile
24+
volumes:
25+
- ./packages/core-components/__snapshots__:/b2b/packages/core-components/__snapshots__
26+
depends_on:
27+
storybook:
28+
condition: service_healthy
29+
command: npx test-storybook --verbose --url http://storybook:6006

0 commit comments

Comments
 (0)