@brightspace-ui/testing 0.31.0 → 0.31.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 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": "0.31.0",
5
+ "version": "0.31.1",
6
6
  "repository": "https://github.com/BrightspaceUI/testing.git",
7
7
  "scripts": {
8
8
  "lint": "eslint . --ext .js",
@@ -36,8 +36,9 @@
36
36
  "access": "public"
37
37
  },
38
38
  "dependencies": {
39
- "@rollup/plugin-node-resolve": "^15",
39
+ "@brightspace-ui/intl": "^3",
40
40
  "@open-wc/testing": "^3",
41
+ "@rollup/plugin-node-resolve": "^15",
41
42
  "@web/config-loader": "^0.2",
42
43
  "@web/dev-server": "^0.2",
43
44
  "@web/rollup-plugin-html": "^2",
@@ -1,4 +1,5 @@
1
1
  import { sendMouse, setViewport } from '@web/test-runner-commands';
2
+ import { getDocumentLocaleSettings } from '@brightspace-ui/intl/lib/common.js';
2
3
  import { nextFrame } from '@open-wc/testing';
3
4
 
4
5
  const DEFAULT_LANG = 'en',
@@ -6,7 +7,9 @@ const DEFAULT_LANG = 'en',
6
7
  DEFAULT_VIEWPORT_HEIGHT = 800,
7
8
  DEFAULT_VIEWPORT_WIDTH = 800;
8
9
 
9
- let currentLang = undefined,
10
+ const documentLocaleSettings = getDocumentLocaleSettings();
11
+
12
+ let
10
13
  currentMathjaxRenderLatex = DEFAULT_MATHJAX_RENDER_LATEX,
11
14
  currentRtl = false,
12
15
  currentViewportHeight = 0,
@@ -57,9 +60,9 @@ export async function reset(opts = {}) {
57
60
  currentRtl = opts.rtl;
58
61
  }
59
62
 
60
- if (opts.lang !== currentLang) {
61
- document.documentElement.setAttribute('lang', opts.lang);
62
- currentLang = opts.lang;
63
+ opts.lang ??= '';
64
+ if (documentLocaleSettings.lamguage !== opts.lang) {
65
+ document.documentElement.lang = opts.lang;
63
66
  awaitNextFrame = true;
64
67
  }
65
68