@comicrelief/storybook 1.30.2 → 1.30.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/index.js +1 -1
- package/coverage/clover.xml +177 -0
- package/coverage/coverage-final.json +9 -0
- package/coverage/lcov-report/base.css +212 -0
- package/coverage/lcov-report/index.html +125 -0
- package/coverage/lcov-report/prettify.css +1 -0
- package/coverage/lcov-report/prettify.js +1 -0
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +158 -0
- package/coverage/lcov-report/src/components/FileUp/FileUp.js.html +543 -0
- package/coverage/lcov-report/src/components/FileUp/index.html +73 -0
- package/coverage/lcov-report/src/components/FileUp/src/service/S3FileUploadService.js.html +177 -0
- package/coverage/lcov-report/src/components/FileUp/src/service/index.html +73 -0
- package/coverage/lcov-report/src/components/SchoolsLookUp/SchoolsLookUp.js.html +1725 -0
- package/coverage/lcov-report/src/components/SchoolsLookUp/index.html +73 -0
- package/coverage/lcov-report/src/utils/index.html +73 -0
- package/coverage/lcov-report/src/utils/newid.js.html +63 -0
- package/coverage/lcov-report/tests/mocks/enzyme.js.html +69 -0
- package/coverage/lcov-report/tests/mocks/fileMock.js.html +48 -0
- package/coverage/lcov-report/tests/mocks/index.html +112 -0
- package/coverage/lcov-report/tests/mocks/shim.js.html +54 -0
- package/coverage/lcov-report/tests/mocks/styleMock.js.html +48 -0
- package/coverage/lcov.info +400 -0
- package/cypress/snapshots/All Specs/__diff_output__/Browser Support message -- should load default story.diff.png +0 -0
- package/cypress/snapshots/All Specs/__diff_output__/Checkbox Field -- should click checkbox.diff.png +0 -0
- package/cypress/snapshots/All Specs/__diff_output__/Checkbox Field -- should load default story.diff.png +0 -0
- package/cypress/snapshots/All Specs/__diff_output__/Cookie Consent Message -- should load default story.diff.png +0 -0
- package/cypress/snapshots/All Specs/__diff_output__/File Upload -- should load default story.diff.png +0 -0
- package/package.json +1 -1
- package/src/components/PostcodeLookup/PostcodeLookup.js +6 -1
- package/cypress/snapshots/All Specs/__diff_output__/Grants Infographics -- should load default story.diff.png +0 -0
- package/cypress/snapshots/All Specs/__diff_output__/Input Field -- should load Checkbox story.diff.png +0 -0
- package/cypress/snapshots/All Specs/__diff_output__/Input Field -- should load Email Field story.diff.png +0 -0
- package/cypress/snapshots/All Specs/__diff_output__/Input Field -- should load Number Field story.diff.png +0 -0
- package/cypress/snapshots/All Specs/__diff_output__/Input Field -- should load Number Field with all props possible story.diff.png +0 -0
- package/cypress/snapshots/All Specs/__diff_output__/Input Field -- should load Optional text Field with only required props story.diff.png +0 -0
- package/cypress/snapshots/All Specs/__diff_output__/Input Field -- should load Telephone Field story.diff.png +0 -0
- package/cypress/snapshots/All Specs/__diff_output__/Input Field -- should load Text Field story.diff.png +0 -0
- package/cypress/snapshots/All Specs/__diff_output__/Input Field -- should load Text Field with inline button story.diff.png +0 -0
- package/cypress/snapshots/All Specs/__diff_output__/Just In Time Message -- should load default story.diff.png +0 -0
- package/cypress/snapshots/All Specs/__diff_output__/Marketing Consent -- should load default story.diff.png +0 -0
- package/cypress/snapshots/All Specs/__diff_output__/Postcode Lookup -- should load default story.diff.png +0 -0
- package/cypress/snapshots/All Specs/__diff_output__/Postcode Lookup -- should load results.diff.png +0 -0
- package/cypress/snapshots/All Specs/__diff_output__/Radio Buttons -- should load default story.diff.png +0 -0
- package/cypress/snapshots/All Specs/__diff_output__/Schools Lookup -- should load EDCO selected school story.diff.png +0 -0
- package/cypress/snapshots/All Specs/__diff_output__/Schools Lookup -- should load manual fields errors story.diff.png +0 -0
- package/cypress/snapshots/All Specs/__diff_output__/Schools Lookup -- should load manually entered school story.diff.png +0 -0
- package/cypress/snapshots/All Specs/__diff_output__/Schools Lookup -- should load nothing is selected story.diff.png +0 -0
- package/cypress/snapshots/All Specs/__diff_output__/Schools Lookup -- should load results.diff.png +0 -0
- package/yarn-error.log +0 -15344
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<title>Code coverage report for src/components/FileUp/src/service/S3FileUploadService.js</title>
|
|
5
|
+
<meta charset="utf-8" />
|
|
6
|
+
<link rel="stylesheet" href="../../../../../prettify.css" />
|
|
7
|
+
<link rel="stylesheet" href="../../../../../base.css" />
|
|
8
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
9
|
+
<style type='text/css'>
|
|
10
|
+
.coverage-summary .sorter {
|
|
11
|
+
background-image: url(../../../../../sort-arrow-sprite.png);
|
|
12
|
+
}
|
|
13
|
+
</style>
|
|
14
|
+
</head>
|
|
15
|
+
<body>
|
|
16
|
+
<div class='wrapper'>
|
|
17
|
+
<div class='pad1'>
|
|
18
|
+
<h1>
|
|
19
|
+
<a href="../../../../../index.html">All files</a> / <a href="index.html">src/components/FileUp/src/service</a> S3FileUploadService.js
|
|
20
|
+
</h1>
|
|
21
|
+
<div class='clearfix'>
|
|
22
|
+
</div>
|
|
23
|
+
</div>
|
|
24
|
+
<div class='status-line low'></div>
|
|
25
|
+
<pre><table class="coverage">
|
|
26
|
+
<tr><td class="line-count quiet">1
|
|
27
|
+
2
|
|
28
|
+
3
|
|
29
|
+
4
|
|
30
|
+
5
|
|
31
|
+
6
|
|
32
|
+
7
|
|
33
|
+
8
|
|
34
|
+
9
|
|
35
|
+
10
|
|
36
|
+
11
|
|
37
|
+
12
|
|
38
|
+
13
|
|
39
|
+
14
|
|
40
|
+
15
|
|
41
|
+
16
|
|
42
|
+
17
|
|
43
|
+
18
|
|
44
|
+
19
|
|
45
|
+
20
|
|
46
|
+
21
|
|
47
|
+
22
|
|
48
|
+
23
|
|
49
|
+
24
|
|
50
|
+
25
|
|
51
|
+
26
|
|
52
|
+
27
|
|
53
|
+
28
|
|
54
|
+
29
|
|
55
|
+
30
|
|
56
|
+
31
|
|
57
|
+
32
|
|
58
|
+
33
|
|
59
|
+
34
|
|
60
|
+
35
|
|
61
|
+
36
|
|
62
|
+
37
|
|
63
|
+
38
|
|
64
|
+
39
|
|
65
|
+
40
|
|
66
|
+
41
|
|
67
|
+
42
|
|
68
|
+
43
|
|
69
|
+
44
|
|
70
|
+
45</td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
|
71
|
+
<span class="cline-any cline-neutral"> </span>
|
|
72
|
+
<span class="cline-any cline-neutral"> </span>
|
|
73
|
+
<span class="cline-any cline-neutral"> </span>
|
|
74
|
+
<span class="cline-any cline-neutral"> </span>
|
|
75
|
+
<span class="cline-any cline-neutral"> </span>
|
|
76
|
+
<span class="cline-any cline-neutral"> </span>
|
|
77
|
+
<span class="cline-any cline-neutral"> </span>
|
|
78
|
+
<span class="cline-any cline-neutral"> </span>
|
|
79
|
+
<span class="cline-any cline-neutral"> </span>
|
|
80
|
+
<span class="cline-any cline-no"> </span>
|
|
81
|
+
<span class="cline-any cline-no"> </span>
|
|
82
|
+
<span class="cline-any cline-neutral"> </span>
|
|
83
|
+
<span class="cline-any cline-neutral"> </span>
|
|
84
|
+
<span class="cline-any cline-neutral"> </span>
|
|
85
|
+
<span class="cline-any cline-no"> </span>
|
|
86
|
+
<span class="cline-any cline-neutral"> </span>
|
|
87
|
+
<span class="cline-any cline-no"> </span>
|
|
88
|
+
<span class="cline-any cline-neutral"> </span>
|
|
89
|
+
<span class="cline-any cline-neutral"> </span>
|
|
90
|
+
<span class="cline-any cline-neutral"> </span>
|
|
91
|
+
<span class="cline-any cline-neutral"> </span>
|
|
92
|
+
<span class="cline-any cline-neutral"> </span>
|
|
93
|
+
<span class="cline-any cline-neutral"> </span>
|
|
94
|
+
<span class="cline-any cline-neutral"> </span>
|
|
95
|
+
<span class="cline-any cline-neutral"> </span>
|
|
96
|
+
<span class="cline-any cline-neutral"> </span>
|
|
97
|
+
<span class="cline-any cline-neutral"> </span>
|
|
98
|
+
<span class="cline-any cline-neutral"> </span>
|
|
99
|
+
<span class="cline-any cline-no"> </span>
|
|
100
|
+
<span class="cline-any cline-neutral"> </span>
|
|
101
|
+
<span class="cline-any cline-no"> </span>
|
|
102
|
+
<span class="cline-any cline-no"> </span>
|
|
103
|
+
<span class="cline-any cline-no"> </span>
|
|
104
|
+
<span class="cline-any cline-neutral"> </span>
|
|
105
|
+
<span class="cline-any cline-no"> </span>
|
|
106
|
+
<span class="cline-any cline-neutral"> </span>
|
|
107
|
+
<span class="cline-any cline-no"> </span>
|
|
108
|
+
<span class="cline-any cline-neutral"> </span>
|
|
109
|
+
<span class="cline-any cline-neutral"> </span>
|
|
110
|
+
<span class="cline-any cline-neutral"> </span>
|
|
111
|
+
<span class="cline-any cline-neutral"> </span>
|
|
112
|
+
<span class="cline-any cline-neutral"> </span>
|
|
113
|
+
<span class="cline-any cline-neutral"> </span>
|
|
114
|
+
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">import axios from 'axios';
|
|
115
|
+
|
|
116
|
+
class S3FileUploadService {
|
|
117
|
+
/**
|
|
118
|
+
* Generate a signed S3 upload url.
|
|
119
|
+
* @param signedUrlEndpoint
|
|
120
|
+
* @param file
|
|
121
|
+
* @return {Promise}
|
|
122
|
+
*/
|
|
123
|
+
<span class="fstat-no" title="function not covered" > st</span>atic generateSignedUrl(signedUrlEndpoint, file) {
|
|
124
|
+
<span class="cstat-no" title="statement not covered" > return new Promise(<span class="fstat-no" title="function not covered" >(r</span>esolve, reject) => {</span>
|
|
125
|
+
<span class="cstat-no" title="statement not covered" > axios.post(signedUrlEndpoint, {</span>
|
|
126
|
+
name: file.name,
|
|
127
|
+
type: file.type,
|
|
128
|
+
}).then(<span class="fstat-no" title="function not covered" >(r</span>esponse) => {
|
|
129
|
+
<span class="cstat-no" title="statement not covered" > resolve(response.data.data);</span>
|
|
130
|
+
}).catch(<span class="fstat-no" title="function not covered" >(e</span>rror) => {
|
|
131
|
+
<span class="cstat-no" title="statement not covered" > reject(error);</span>
|
|
132
|
+
});
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* Upload the file to S3.
|
|
138
|
+
* @param signedUrlEndpoint
|
|
139
|
+
* @param file
|
|
140
|
+
* @return {Promise}
|
|
141
|
+
*/
|
|
142
|
+
<span class="fstat-no" title="function not covered" > up</span>loadFile(signedUrlEndpoint, file) {
|
|
143
|
+
<span class="cstat-no" title="statement not covered" > return new Promise(<span class="fstat-no" title="function not covered" >(r</span>esolve, reject) => {</span>
|
|
144
|
+
let fileData;
|
|
145
|
+
<span class="cstat-no" title="statement not covered" > this.generateSignedUrl(signedUrlEndpoint, file).then(<span class="fstat-no" title="function not covered" >(f</span>ileUploadData) => {</span>
|
|
146
|
+
<span class="cstat-no" title="statement not covered" > fileData = fileUploadData;</span>
|
|
147
|
+
<span class="cstat-no" title="statement not covered" > return axios.put(fileData.upload_url, file);</span>
|
|
148
|
+
}).then(<span class="fstat-no" title="function not covered" >()</span> => {
|
|
149
|
+
<span class="cstat-no" title="statement not covered" > resolve(fileData.file_url);</span>
|
|
150
|
+
}).catch(<span class="fstat-no" title="function not covered" >(e</span>rror) => {
|
|
151
|
+
<span class="cstat-no" title="statement not covered" > reject(error);</span>
|
|
152
|
+
});
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
export default S3FileUploadService;
|
|
158
|
+
</pre></td></tr>
|
|
159
|
+
</table></pre>
|
|
160
|
+
<div class='push'></div><!-- for sticky footer -->
|
|
161
|
+
</div><!-- /wrapper -->
|
|
162
|
+
<div class='footer quiet pad2 space-top1 center small'>
|
|
163
|
+
Code coverage
|
|
164
|
+
generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at Tue Nov 01 2022 13:40:05 GMT+0000 (Greenwich Mean Time)
|
|
165
|
+
</div>
|
|
166
|
+
</div>
|
|
167
|
+
<script src="../../../../../prettify.js"></script>
|
|
168
|
+
<script>
|
|
169
|
+
window.onload = function () {
|
|
170
|
+
if (typeof prettyPrint === 'function') {
|
|
171
|
+
prettyPrint();
|
|
172
|
+
}
|
|
173
|
+
};
|
|
174
|
+
</script>
|
|
175
|
+
<script src="../../../../../sorter.js"></script>
|
|
176
|
+
</body>
|
|
177
|
+
</html>
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<title>Code coverage report for src/components/FileUp/src/service</title>
|
|
5
|
+
<meta charset="utf-8" />
|
|
6
|
+
<link rel="stylesheet" href="../../../../../prettify.css" />
|
|
7
|
+
<link rel="stylesheet" href="../../../../../base.css" />
|
|
8
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
9
|
+
<style type='text/css'>
|
|
10
|
+
.coverage-summary .sorter {
|
|
11
|
+
background-image: url(../../../../../sort-arrow-sprite.png);
|
|
12
|
+
}
|
|
13
|
+
</style>
|
|
14
|
+
</head>
|
|
15
|
+
<body>
|
|
16
|
+
<div class='wrapper'>
|
|
17
|
+
<div class='pad1'>
|
|
18
|
+
<h1>
|
|
19
|
+
<a href="../../../../../index.html">All files</a> src/components/FileUp/src/service
|
|
20
|
+
</h1>
|
|
21
|
+
<div class='clearfix'>
|
|
22
|
+
</div>
|
|
23
|
+
</div>
|
|
24
|
+
<div class='status-line low'></div>
|
|
25
|
+
<div class="pad1">
|
|
26
|
+
<table class="coverage-summary">
|
|
27
|
+
<thead>
|
|
28
|
+
<tr>
|
|
29
|
+
<th data-col="file" data-fmt="html" data-html="true" class="file">File</th>
|
|
30
|
+
<th data-col="pic" data-type="number" data-fmt="html" data-html="true" class="pic"></th>
|
|
31
|
+
<th data-col="statements" data-type="number" data-fmt="pct" class="pct">Statements</th>
|
|
32
|
+
<th data-col="statements_raw" data-type="number" data-fmt="html" class="abs"></th>
|
|
33
|
+
<th data-col="branches" data-type="number" data-fmt="pct" class="pct">Branches</th>
|
|
34
|
+
<th data-col="branches_raw" data-type="number" data-fmt="html" class="abs"></th>
|
|
35
|
+
<th data-col="functions" data-type="number" data-fmt="pct" class="pct">Functions</th>
|
|
36
|
+
<th data-col="functions_raw" data-type="number" data-fmt="html" class="abs"></th>
|
|
37
|
+
<th data-col="lines" data-type="number" data-fmt="pct" class="pct">Lines</th>
|
|
38
|
+
<th data-col="lines_raw" data-type="number" data-fmt="html" class="abs"></th>
|
|
39
|
+
</tr>
|
|
40
|
+
</thead>
|
|
41
|
+
<tbody><tr>
|
|
42
|
+
<td class="file low" data-value="S3FileUploadService.js"><a href="S3FileUploadService.js.html">S3FileUploadService.js</a></td>
|
|
43
|
+
<td data-value="" class="pic low"><div class="chart"><div class="cover-fill" style="width: 0%;"></div><div class="cover-empty" style="width:100%;"></div></div></td>
|
|
44
|
+
<td data-value="" class="pct low">%</td>
|
|
45
|
+
<td data-value="" class="abs low">/</td>
|
|
46
|
+
<td data-value="" class="pct high">%</td>
|
|
47
|
+
<td data-value="" class="abs high">/</td>
|
|
48
|
+
<td data-value="" class="pct low">%</td>
|
|
49
|
+
<td data-value="" class="abs low">/</td>
|
|
50
|
+
<td data-value="" class="pct low">%</td>
|
|
51
|
+
<td data-value="" class="abs low">/</td>
|
|
52
|
+
</tr>
|
|
53
|
+
|
|
54
|
+
</tbody>
|
|
55
|
+
</table>
|
|
56
|
+
</div><div class='push'></div><!-- for sticky footer -->
|
|
57
|
+
</div><!-- /wrapper -->
|
|
58
|
+
<div class='footer quiet pad2 space-top1 center small'>
|
|
59
|
+
Code coverage
|
|
60
|
+
generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at Tue Nov 01 2022 13:40:05 GMT+0000 (Greenwich Mean Time)
|
|
61
|
+
</div>
|
|
62
|
+
</div>
|
|
63
|
+
<script src="../../../../../prettify.js"></script>
|
|
64
|
+
<script>
|
|
65
|
+
window.onload = function () {
|
|
66
|
+
if (typeof prettyPrint === 'function') {
|
|
67
|
+
prettyPrint();
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
</script>
|
|
71
|
+
<script src="../../../../../sorter.js"></script>
|
|
72
|
+
</body>
|
|
73
|
+
</html>
|