@brightspace-ui/testing 1.13.2 → 1.13.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/README.md CHANGED
@@ -315,21 +315,21 @@ it('should not wait', async() => {
315
315
 
316
316
  #### Waiting for a Condition
317
317
 
318
- In cases where there are no other reliable hooks (like events, `getUpdateComplete()` or `getLoadingComplete()`), `waitUntil(condition)` can be used to wait for a particular condition to become `true`. The condition can optionally return a Promise.
318
+ In cases where there are no other reliable hooks (like events, `getUpdateComplete()` or `getLoadingComplete()`), `waitUntil(condition, failMessage)` can be used to wait for a particular condition to become `true`. The condition can optionally return a Promise.
319
319
 
320
320
  ```javascript
321
321
  import { fixture, waitUntil } from '@brightspace-ui/testing';
322
322
 
323
323
  it('should wait for condition', async() => {
324
324
  const elem = await fixture(...);
325
- await waitUntil(() => elem.foo === 'bar');
325
+ await waitUntil(() => elem.foo === 'bar', 'foo never became "bar"');
326
326
  });
327
327
  ```
328
328
 
329
329
  By default, `waitUntil` will poll every `50ms` and time out after `1000ms`. Those options can be configured:
330
330
 
331
331
  ```javascript
332
- await waitUntil(() => elem.condition, {
332
+ await waitUntil(() => elem.condition, 'Condition was never met', {
333
333
  interval: 10,
334
334
  timeout: 2000
335
335
  });
package/package.json CHANGED
@@ -2,10 +2,12 @@
2
2
  "name": "@brightspace-ui/testing",
3
3
  "description": "Utilities for testing front-end components and applications",
4
4
  "type": "module",
5
- "version": "1.13.2",
5
+ "version": "1.13.4",
6
6
  "repository": "https://github.com/BrightspaceUI/testing.git",
7
7
  "scripts": {
8
- "lint": "eslint . --ext .js",
8
+ "lint": "npm run lint:eslint && npm run lint:style",
9
+ "lint:eslint": "eslint . --ext .js",
10
+ "lint:style": "stylelint \"**/*.{js,html}\" --ignore-path .gitignore",
9
11
  "test": "npm run lint && npm run test:bin && npm run test:server && npm run test:browser",
10
12
  "test:bin": "mocha './test/bin/**/*.test.js'",
11
13
  "test:browser": "npm run test:browser:other && npm run test:browser:ctor",
@@ -21,11 +23,13 @@
21
23
  "author": "D2L Corporation",
22
24
  "license": "Apache-2.0",
23
25
  "devDependencies": {
26
+ "@brightspace-ui/stylelint-config": "^1",
24
27
  "chai": "^5",
25
28
  "eslint": "^8",
26
29
  "eslint-config-brightspace": "^1",
27
30
  "mocha": "^10",
28
- "sinon": "^17"
31
+ "sinon": "^17",
32
+ "stylelint": "^16"
29
33
  },
30
34
  "exports": {
31
35
  ".": "./src/browser/index.js"
@@ -49,5 +49,6 @@ export async function sendKeysElem(elem, action, keys) {
49
49
  if (elem) {
50
50
  await focusElem(elem);
51
51
  }
52
+ await new Promise(r => setTimeout(r));
52
53
  return sendKeys(action, keys);
53
54
  }
@@ -25,9 +25,9 @@ class App extends LitElement {
25
25
  overflow: hidden;
26
26
  }
27
27
  aside {
28
- background-color: #fff;
28
+ background-color: #ffffff;
29
29
  border-right: 1px solid #e6e6e6;
30
- box-shadow: 0 0 6px rgba(0,0,0,.07);
30
+ box-shadow: 0 0 6px rgba(0, 0, 0, 0.07);
31
31
  padding: 20px;
32
32
  }
33
33
  main {
@@ -57,8 +57,8 @@ class App extends LitElement {
57
57
  tbody th {
58
58
  font-weight: normal;
59
59
  text-align: left;
60
- width: 100%;
61
60
  white-space: normal;
61
+ width: 100%;
62
62
  }
63
63
  td.passed {
64
64
  background-color: #efffd9;
@@ -82,7 +82,7 @@ class App extends LitElement {
82
82
  .header {
83
83
  background-color: #f0f0f0;
84
84
  border-bottom: 1px solid #cdd5dc;
85
- box-shadow: 0 0 6px rgba(0,0,0,.07);
85
+ box-shadow: 0 0 6px rgba(0, 0, 0, 0.07);
86
86
  }
87
87
  .tab-panels {
88
88
  overflow: auto;
@@ -100,8 +100,8 @@ class App extends LitElement {
100
100
  .settings {
101
101
  align-items: center;
102
102
  display: flex;
103
- padding: 20px;
104
103
  gap: 10px;
104
+ padding: 20px;
105
105
  }
106
106
  .settings > * {
107
107
  flex: 0 0 auto;
@@ -7,9 +7,9 @@
7
7
  <link rel="preconnect" href="https://fonts.googleapis.com">
8
8
  <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
9
9
  <style>
10
- @import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap');
10
+ @import url("https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap");
11
11
  body {
12
- font-family: 'Roboto', sans-serif;
12
+ font-family: "Roboto", sans-serif;
13
13
  font-size: 16px;
14
14
  margin: 0;
15
15
  }
@@ -8,17 +8,17 @@ export const RADIO_STYLE = css`
8
8
  flex-wrap: nowrap;
9
9
  }
10
10
  .radio-item input[type="radio"] {
11
- position: absolute;
12
11
  opacity: 0;
13
12
  pointer-events: none;
13
+ position: absolute;
14
14
  }
15
15
  .radio-item label {
16
16
  align-items: center;
17
17
  background-color: #ffffff;
18
18
  border-block-end-style: solid;
19
19
  border-block-start-style: solid;
20
- border-inline-start-style: solid;
21
20
  border-color: #cdd5dc;
21
+ border-inline-start-style: solid;
22
22
  border-width: 1px;
23
23
  cursor: pointer;
24
24
  display: flex;
@@ -29,8 +29,8 @@ export const RADIO_STYLE = css`
29
29
  user-select: none;
30
30
  }
31
31
  .radio-item:first-child label {
32
- border-start-start-radius: 5px;
33
32
  border-end-start-radius: 5px;
33
+ border-start-start-radius: 5px;
34
34
  }
35
35
  .radio-item:last-child label {
36
36
  border-end-end-radius: 5px;
@@ -42,9 +42,9 @@ export const RADIO_STYLE = css`
42
42
  color: white;
43
43
  }
44
44
  .radio-item input[type="radio"]:focus-visible + label {
45
- z-index: 1;
46
45
  border-color: #007bff;
47
46
  box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px #007bff;
47
+ z-index: 1;
48
48
  }
49
49
  `;
50
50
 
@@ -23,9 +23,9 @@ export const RESULT_STYLE = css`
23
23
  font-weight: bold;
24
24
  }
25
25
  .result-split {
26
+ display: flex;
26
27
  flex-direction: row;
27
28
  flex-wrap: nowrap;
28
- display: flex;
29
29
  }
30
30
  .result-split > .result-part {
31
31
  flex: 0 1 auto;
@@ -54,14 +54,14 @@ export const RESULT_STYLE = css`
54
54
  .result-split > .result-part:first-of-type > div > .result-diff-container {
55
55
  border-right: none;
56
56
  }
57
- .result-split > .result-part:last-of-type > div> .result-diff-container {
57
+ .result-split > .result-part:last-of-type > div > .result-diff-container {
58
58
  border-left: none;
59
59
  }
60
60
  .result-overlay {
61
- background: hsla(0,0%,100%,.8);
61
+ background: hsla(0, 0%, 100%, 0.8);
62
+ left: 0;
62
63
  position: absolute;
63
64
  top: 0;
64
- left: 0;
65
65
  }
66
66
  .result-part-info {
67
67
  align-items: center;
@@ -56,8 +56,8 @@ export const TAB_STYLE = css`
56
56
  }
57
57
  .tab-selected-indicator {
58
58
  border-block-start: 4px solid #007bff;
59
- border-start-start-radius: 4px;
60
59
  border-start-end-radius: 4px;
60
+ border-start-start-radius: 4px;
61
61
  bottom: 0;
62
62
  position: absolute;
63
63
  width: calc(100% - 30px);