@pie-element/rubric 3.9.1-next.0 → 3.9.1-next.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.
@@ -18,6 +18,18 @@ const model = (extras) => ({
18
18
  maxPointsEnabled: true,
19
19
  ...extras,
20
20
  });
21
+
22
+ const invalidModel = (extras) => ({
23
+ id: '2',
24
+ element: 'pie-rubric',
25
+ points: ['A', 'B', 'C', 'D'],
26
+ sampleAnswers: [true, true, false, false],
27
+ maxPoints: 5,
28
+ excludeZero: false,
29
+ excludeZeroEnabled: true,
30
+ maxPointsEnabled: true,
31
+ ...extras,
32
+ });
21
33
  const configuration = (c) => ({...defaults.configuration, ...c});
22
34
 
23
35
  describe('RubricElement', () => {
@@ -149,6 +161,13 @@ describe('RubricElement', () => {
149
161
  expect(result.points).toEqual(['B']);
150
162
  expect(result.sampleAnswers).toEqual([true]);
151
163
  });
164
+
165
+ it('should handle case if invalid model is set, after updateModelAccordingToReceivedProps the returned model is valid', () => {
166
+ const newModel = invalidModel();
167
+ element.onModelChanged(newModel);
168
+ expect(element._model.points).toEqual(["A", "B", "C", "D", "", ""]);
169
+ expect(element._model.sampleAnswers).toEqual([true, true, false, false, null, null]);
170
+ });
152
171
  });
153
172
 
154
173
  });
@@ -1,4 +1,4 @@
1
- import {_dll_react, _dll_prop_types, _dll_classnames, _dll_react_dom, _dll_lodash, _dll_debug} from "../../../@pie-lib/pie-toolbox-math-rendering-module@1.7.1/module/index.js";
1
+ import {_dll_react, _dll_prop_types, _dll_classnames, _dll_react_dom, _dll_lodash, _dll_debug} from "../../../@pie-lib/pie-toolbox-math-rendering-module@1.8.0/module/index.js";
2
2
  import {_dll_pie_lib__pie_toolbox_editable_html, _dll_pie_lib__pie_toolbox_config_ui} from "../../../@pie-lib/pie-toolbox-module@4.0.0/module/index.js";
3
3
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
4
4
  function getDefaultExportFromCjs(x) {
package/module/element.js CHANGED
@@ -1,4 +1,4 @@
1
- import {_dll_react, _dll_prop_types, _dll_react_dom, _dll_classnames, _dll_debug} from "../../../@pie-lib/pie-toolbox-math-rendering-module@1.7.1/module/index.js";
1
+ import {_dll_react, _dll_prop_types, _dll_react_dom, _dll_classnames, _dll_debug} from "../../../@pie-lib/pie-toolbox-math-rendering-module@1.8.0/module/index.js";
2
2
  import {_dll_pie_lib__pie_toolbox_render_ui} from "../../../@pie-lib/pie-toolbox-module@4.0.0/module/index.js";
3
3
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
4
4
  function getDefaultExportFromCjs(x) {
@@ -4,7 +4,7 @@
4
4
  "modules": [
5
5
  {
6
6
  "name": "@pie-lib/pie-toolbox-math-rendering-module",
7
- "version": "1.7.1"
7
+ "version": "1.8.0"
8
8
  },
9
9
  {
10
10
  "name": "@pie-lib/pie-toolbox-module",
package/module/print.js CHANGED
@@ -1,4 +1,4 @@
1
- import {_dll_react, _dll_prop_types, _dll_react_dom, _dll_classnames, _dll_lodash, _dll_pie_lib__pie_toolbox_math_rendering_accessible, _dll_debug} from "../../../@pie-lib/pie-toolbox-math-rendering-module@1.7.1/module/index.js";
1
+ import {_dll_react, _dll_prop_types, _dll_react_dom, _dll_classnames, _dll_lodash, _dll_pie_lib__pie_toolbox_math_rendering_accessible, _dll_debug} from "../../../@pie-lib/pie-toolbox-math-rendering-module@1.8.0/module/index.js";
2
2
  import {_dll_pie_lib__pie_toolbox_render_ui} from "../../../@pie-lib/pie-toolbox-module@4.0.0/module/index.js";
3
3
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
4
4
  function getDefaultExportFromCjs(x) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pie-element/rubric",
3
- "version": "3.9.1-next.0+abbffaffb",
3
+ "version": "3.9.1-next.4+6e2584f69",
4
4
  "main": "lib/index.js",
5
5
  "module": "src/index.js",
6
6
  "description": "Rubric Scoring Interaction",
@@ -15,7 +15,7 @@
15
15
  },
16
16
  "author": "pie framework developers",
17
17
  "license": "ISC",
18
- "gitHead": "abbffaffb9b79d3f36a10d912f281fb094be8252",
18
+ "gitHead": "6e2584f690a90e30a54d01d2aece0cff542a1c75",
19
19
  "scripts": {
20
20
  "postpublish": "../../scripts/postpublish"
21
21
  },