Skip to content

Commit

Permalink
Fix storyshots (#96)
Browse files Browse the repository at this point in the history
* fix

* artifacts

* fix font

* fix font

* ubuntu?

* ubuntu? v2

* common controls style

* meh

* m?

* m?

* m?

* generate screenshots

* generate screenshots

* generate screenshots

* updated

* updated

* updated

* should fail

* success
  • Loading branch information
dangreen authored Sep 7, 2019
1 parent f954d73 commit 12701f1
Show file tree
Hide file tree
Showing 11 changed files with 10 additions and 23 deletions.
1 change: 0 additions & 1 deletion .storybook/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import '../src/App/App.st.css';

if (process.env.SEED) {
faker.seed(parseInt(process.env.SEED));
document.body.style.fontFamily = 'Arial';
}

const stories = require.context(
Expand Down
8 changes: 3 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ node_js:
cache:
directories:
- node_modules
before_install:
- sudo apt-get update
- echo ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true | sudo debconf-set-selections
- sudo apt-get install -y msttcorefonts
after_failure: npm run artifacts
after_script:
# - npm run jest -u
- npm run artifacts
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"lint": "trigen-scripts lint",
"jest": "trigen-scripts jest",
"test": "SEED=584 npm run build:storybook && trigen-scripts test",
"artifacts": "trigen-scripts artifacts test/__image_snapshots__/__diff_output__",
"artifacts": "trigen-scripts artifacts test/__image_snapshots__",
"build:favicons": "trigen-scripts build:favicons --androidBackground white -m src/manifest.json",
"build:docs": "trigen-scripts build:docs",
"start:storybook": "trigen-scripts start:storybook -c .storybook",
Expand Down
Binary file modified test/__image_snapshots__/Navigator__with-3-items-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/__image_snapshots__/TodoForm__with-basic-data-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/__image_snapshots__/TodoItem__with-basic-data-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/__image_snapshots__/TodoList__with-basic-data-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/__image_snapshots__/WeatherList__with-items-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/__image_snapshots__/Weather__with-basic-data-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/__image_snapshots__/Weather__with-small-size-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 6 additions & 16 deletions test/storyshots.spec.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,7 @@
import initStoryshots, {
getMatchOptions
} from '@trigen/scripts-plugin-storybook/jest/storyshots';
import initStoryshots from '@trigen/scripts-plugin-storybook/jest/storyshots';

initStoryshots({
getMatchOptions(info) {

const options = getMatchOptions(info);
const failureThreshold = 0.03;

return {
failureThresholdType: 'percent',
failureThreshold,
...options
};
}
});
if (process.platform === 'linux') {
initStoryshots();
} else {
it('should skip storyshots', () => {});
}

0 comments on commit 12701f1

Please sign in to comment.