@brightspace-ui/testing 1.13.3 → 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,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.13.3",
5
+ "version": "1.13.4",
6
6
  "repository": "https://github.com/BrightspaceUI/testing.git",
7
7
  "scripts": {
8
8
  "lint": "npm run lint:eslint && npm run lint:style",
@@ -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
  }