@brightspace-ui/testing 1.43.0 → 1.44.1
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/package.json +2 -2
- package/src/server/wtr-config.js +11 -8
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@brightspace-ui/testing",
|
|
3
3
|
"description": "Utilities for testing front-end components and applications",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"version": "1.
|
|
5
|
+
"version": "1.44.1",
|
|
6
6
|
"repository": "https://github.com/BrightspaceUI/testing.git",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"lint": "npm run lint:eslint && npm run lint:style",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"eslint-config-brightspace": "^3",
|
|
30
30
|
"globals": "^17",
|
|
31
31
|
"mocha": "^11",
|
|
32
|
-
"sinon": "^
|
|
32
|
+
"sinon": "^22",
|
|
33
33
|
"stylelint": "^17"
|
|
34
34
|
},
|
|
35
35
|
"exports": {
|
package/src/server/wtr-config.js
CHANGED
|
@@ -66,7 +66,7 @@ const HTML_BODY = testFramework => `
|
|
|
66
66
|
<script type="module" src="${testFramework}"></script>
|
|
67
67
|
</body>
|
|
68
68
|
`;
|
|
69
|
-
const HTML_HEAD = `
|
|
69
|
+
const HTML_HEAD = (expandBody = false) => `
|
|
70
70
|
<head>
|
|
71
71
|
<link rel="preload" href="${FONT_ASSETS}Lato-400.woff2" as="font" type="font/woff2" crossorigin>
|
|
72
72
|
<link rel="preload" href="${FONT_ASSETS}Lato-700.woff2" as="font" type="font/woff2" crossorigin>
|
|
@@ -123,6 +123,7 @@ const HTML_HEAD = `
|
|
|
123
123
|
line-height: 1.4rem;
|
|
124
124
|
margin: 0;
|
|
125
125
|
padding: 38px;
|
|
126
|
+
${expandBody ? 'height: 100vh;box-sizing: border-box;' : ''}
|
|
126
127
|
}
|
|
127
128
|
body.no-padding {
|
|
128
129
|
padding: 0;
|
|
@@ -134,11 +135,13 @@ const DEFAULT_TEST_RUNNER_HTML = testFramework => `<!DOCTYPE html>
|
|
|
134
135
|
<html lang="en" data-timezone='${TIMEZONE}'>
|
|
135
136
|
${HTML_BODY(testFramework)}
|
|
136
137
|
</html>`;
|
|
137
|
-
const FULL_TEST_RUNNER_HTML =
|
|
138
|
-
|
|
139
|
-
${
|
|
140
|
-
|
|
141
|
-
|
|
138
|
+
const FULL_TEST_RUNNER_HTML = (expandBody = false) => {
|
|
139
|
+
return testFramework => `<!DOCTYPE html>
|
|
140
|
+
<html lang="en" data-timezone='${TIMEZONE}'>
|
|
141
|
+
${HTML_HEAD(expandBody)}
|
|
142
|
+
${HTML_BODY(testFramework)}
|
|
143
|
+
</html>`;
|
|
144
|
+
};
|
|
142
145
|
|
|
143
146
|
export class WTRConfig {
|
|
144
147
|
|
|
@@ -153,7 +156,7 @@ export class WTRConfig {
|
|
|
153
156
|
name: 'vdiff',
|
|
154
157
|
files: this.#pattern,
|
|
155
158
|
browsers: [BROWSER_MAP.chrome],
|
|
156
|
-
testRunnerHtml: FULL_TEST_RUNNER_HTML
|
|
159
|
+
testRunnerHtml: FULL_TEST_RUNNER_HTML()
|
|
157
160
|
};
|
|
158
161
|
}
|
|
159
162
|
create({
|
|
@@ -180,7 +183,7 @@ export class WTRConfig {
|
|
|
180
183
|
|
|
181
184
|
if (!['test', 'vdiff', ...passthroughGroupNames].includes(group)) {
|
|
182
185
|
const groupConfig = { name: group, files: this.#pattern };
|
|
183
|
-
if (group === 'axe') groupConfig.testRunnerHtml = FULL_TEST_RUNNER_HTML;
|
|
186
|
+
if (group === 'axe') groupConfig.testRunnerHtml = FULL_TEST_RUNNER_HTML(true);
|
|
184
187
|
config.groups.push(groupConfig);
|
|
185
188
|
} else {
|
|
186
189
|
const groupConfig = config.groups.find(g => g.name === group);
|