/
snapshot.stories.js
91 lines (78 loc) · 1.44 KB
/
snapshot.stories.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
import task from '../components/task';
import {
buildComplete,
buildError,
buildFailed,
buildPassed,
initial,
pending,
skipped,
} from './snapshot';
export default {
title: 'CLI/Tasks/Snapshot',
decorators: [(storyFn) => task(storyFn())],
};
const build = {
number: 42,
errorCount: 1,
changeCount: 2,
testCount: 10,
componentCount: 5,
specCount: 8,
features: { uiTests: true },
};
const now = 0;
const startedAt = -123456;
export const Initial = () => initial;
export const Pending = () =>
pending({
build,
options: { only: 'Pages/**' },
cursor: 6,
label: 'ComponentName › StoryName',
});
export const BuildPassed = () =>
buildPassed({
build,
now,
startedAt,
});
export const BuildComplete = () =>
buildComplete({
build,
now,
startedAt,
exitCode: 1,
});
export const BuildAutoAccepted = () =>
buildComplete({
build: { ...build, autoAcceptChanges: true },
now,
startedAt,
});
export const BuildFailed = () =>
buildFailed({
build,
now,
startedAt,
exitCode: 2,
});
export const BuildError = () =>
buildError({
build,
now,
startedAt,
exitCode: 3,
});
export const SkippedPublishOnly = () =>
skipped({
isPublishOnly: true,
});
export const SkippedList = () =>
skipped({
options: { list: true },
});
export const SkippedExitOnceUploaded = () =>
skipped({
options: { exitOnceUploaded: true },
});