Skip to content

Commit 1cb7177

Browse files
authored
Merge pull request #2824 from input-output-hk/fix/ddw-844-fix-storybook
[DDW-844] Fix Storybook knobs
2 parents fea8019 + c35febb commit 1cb7177

File tree

6 files changed

+19
-8
lines changed

6 files changed

+19
-8
lines changed

.github/pull_request_template.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ Open a thread on #daedalus-qa on Slack, mention `@daedalusqa` and `@daedalusteam
4141
- [ ] PR assigned to the PR author(s)
4242
- [ ] `input-output-hk/daedalus-dev` and `input-output-hk/daedalus-qa` assigned as PR reviewers
4343
- [ ] If there are UI changes, Alexander Rukin assigned as an additional reviewer
44-
- [ ] All visual regression testing has been reviewed (Go to Github Actions tab -> Select Chromatic workflow -> Run on your working branch)
44+
- [ ] All visual regression testing has been reviewed (assign `run Chromatic` label to PR to trigger the run)
4545
- [ ] PR has appropriate labels (`release-vNext`, `feature`/`bug`/`chore`, `WIP`)
4646
- [ ] PR link is added to a Jira ticket, ticket moved to In Review
4747
- [ ] PR is updated to the most recent version of the target branch (and there are no conflicts)

.github/workflows/chromatic.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
11
name: 'Chromatic'
22
on:
3-
workflow_dispatch:
3+
pull_request:
4+
types:
5+
- labeled
46
push:
57
branches:
68
- develop
79

810
jobs:
911
chromatic-deployment:
12+
if: contains(github.event.pull_request.labels.*.name, 'run Chromatic')
1013
runs-on: ubuntu-latest
14+
env:
15+
STORYBOOK_FREEZE_DATE: "true"
1116
steps:
1217
- uses: actions/checkout@v1
1318
- name: Setup Node.js

source/renderer/app/i18n/locales/ja-JP.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -694,7 +694,7 @@
694694
"voting.votingRegistration.enterPinCode.step.continueButtonLabel": "続ける",
695695
"voting.votingRegistration.enterPinCode.step.description": "Fund{nextVotingFundNumber}有権者登録のPINコードを入力してください。ここで設定したPINコードと、次のステップで表示されるQRコードは、スマートフォンでCatalyst Votingアプリを使用して投票するときに必要となります。",
696696
"voting.votingRegistration.enterPinCode.step.enterPinCodeLabel": "PINコードを入力してください",
697-
"voting.votingRegistration.enterPinCode.step.errors.invalidPinCode": "!!!Invalid PIN",
697+
"voting.votingRegistration.enterPinCode.step.errors.invalidPinCode": "無効なPINコード",
698698
"voting.votingRegistration.enterPinCode.step.errors.invalidRepeatPinCode": "PINコードが一致しません",
699699
"voting.votingRegistration.enterPinCode.step.reminder": "<span>PINコードを忘れないでください。</span>PINを忘れると本登録で投票することができなくなり、登録手続きをやり直すことになります。",
700700
"voting.votingRegistration.enterPinCode.step.repeatPinCodeLabel": "PINコードを再入力してください",

storybook/config.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1+
import './monkeyPatchDateTime';
12
import React from 'react';
23
import { configure, addDecorator } from '@storybook/react';
3-
import timemachine from 'timemachine';
44
import StoryWrapper from './stories/_support/StoryWrapper';
55
import '!style-loader!css-loader!sass-loader!../source/renderer/app/themes/index.global.scss'; // eslint-disable-line
66

@@ -13,6 +13,3 @@ function loadStories() {
1313
}
1414

1515
configure(loadStories, module);
16-
timemachine.config({
17-
dateString: 'Sat, 01 Jan 2022 10:00:00 GMT',
18-
});

storybook/monkeyPatchDateTime.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// freezing the date is required for producing consistent snapshots
2+
// for visual regression testing with Chromatic
3+
if (process.env.STORYBOOK_FREEZE_DATE === 'true') {
4+
const timemachine = require('timemachine');
5+
6+
timemachine.config({
7+
dateString: 'Sat, 01 Jan 2022 10:00:00 GMT',
8+
});
9+
}

storybook/webpack.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ module.exports = async ({ config }) => {
7272
rules: [
7373
jsxRule,
7474
{
75-
test: /.tsx?$/,
75+
test: /\.tsx?$/,
7676
loader: 'babel-loader',
7777
options: {
7878
presets: [

0 commit comments

Comments
 (0)