@pie-element/hotspot 4.8.4-next.1099 → 4.8.4-next.1118
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/lib/hotspot/container.js +12 -4
- package/lib/hotspot/container.js.map +1 -1
- package/lib/hotspot/index.js +12 -2
- package/lib/hotspot/index.js.map +1 -1
- package/lib/hotspot/polygon.js +37 -17
- package/lib/hotspot/polygon.js.map +1 -1
- package/lib/hotspot/rectangle.js +37 -17
- package/lib/hotspot/rectangle.js.map +1 -1
- package/package.json +2 -2
- package/src/__tests__/__snapshots__/{container-test.jsx.snap → container.test.jsx.snap} +8 -0
- package/src/__tests__/__snapshots__/image.test.jsx.snap +43 -0
- package/src/__tests__/__snapshots__/{polygon-test.jsx.snap → polygon.test.jsx.snap} +11 -0
- package/src/__tests__/__snapshots__/{rectangle-test.jsx.snap → rectangle.test.jsx.snap} +11 -0
- package/src/__tests__/{container-test.jsx → container.test.jsx} +57 -0
- package/src/__tests__/{image-test.jsx → image.test.jsx} +0 -0
- package/src/__tests__/polygon.test.jsx +224 -0
- package/src/__tests__/rectangle.test.jsx +233 -0
- package/src/__tests__/{session-updater-test.jsx → session-updater.test.jsx} +0 -0
- package/src/hotspot/container.jsx +10 -2
- package/src/hotspot/index.jsx +14 -2
- package/src/hotspot/polygon.jsx +35 -15
- package/src/hotspot/rectangle.jsx +35 -15
- package/src/__tests__/__snapshots__/image-test.jsx.snap +0 -21
- package/src/__tests__/polygon-test.jsx +0 -77
- package/src/__tests__/rectangle-test.jsx +0 -78
|
@@ -43,7 +43,8 @@ export class Container extends React.Component {
|
|
|
43
43
|
onSelectChoice,
|
|
44
44
|
shapes: { rectangles, polygons },
|
|
45
45
|
scale: SCALE,
|
|
46
|
-
strokeWidth
|
|
46
|
+
strokeWidth,
|
|
47
|
+
showCorrect
|
|
47
48
|
} = this.props;
|
|
48
49
|
|
|
49
50
|
const width = withProp * SCALE;
|
|
@@ -78,6 +79,7 @@ export class Container extends React.Component {
|
|
|
78
79
|
const selected = this.isSelected(shape);
|
|
79
80
|
const isCorrect = isEvaluateMode ? this.correctness(shape.correct, selected) : undefined;
|
|
80
81
|
const evaluateText = isEvaluateMode ? this.getEvaluateText(shape.correct, selected) : null;
|
|
82
|
+
const markAsCorrect = !!(isEvaluateMode && showCorrect && shape.correct);
|
|
81
83
|
|
|
82
84
|
return (
|
|
83
85
|
<Rectangle
|
|
@@ -97,6 +99,8 @@ export class Container extends React.Component {
|
|
|
97
99
|
x={shape.x}
|
|
98
100
|
y={shape.y}
|
|
99
101
|
strokeWidth={strokeWidth}
|
|
102
|
+
markAsCorrect={markAsCorrect}
|
|
103
|
+
showCorrectEnabled={showCorrect}
|
|
100
104
|
/>
|
|
101
105
|
)
|
|
102
106
|
})}
|
|
@@ -104,6 +108,7 @@ export class Container extends React.Component {
|
|
|
104
108
|
const selected = this.isSelected(polygon);
|
|
105
109
|
const isCorrect = isEvaluateMode ? this.correctness(polygon.correct, selected) : undefined;
|
|
106
110
|
const evaluateText = isEvaluateMode ? this.getEvaluateText(polygon.correct, selected) : null;
|
|
111
|
+
const markAsCorrect = !!(isEvaluateMode && showCorrect && polygon.correct);
|
|
107
112
|
|
|
108
113
|
return (
|
|
109
114
|
<Polygon
|
|
@@ -120,6 +125,8 @@ export class Container extends React.Component {
|
|
|
120
125
|
outlineColor={outlineColor}
|
|
121
126
|
points={polygon.points}
|
|
122
127
|
strokeWidth={strokeWidth}
|
|
128
|
+
markAsCorrect={markAsCorrect}
|
|
129
|
+
showCorrectEnabled={showCorrect}
|
|
123
130
|
/>
|
|
124
131
|
)
|
|
125
132
|
})}
|
|
@@ -173,7 +180,8 @@ Container.propTypes = {
|
|
|
173
180
|
session:PropTypes.object.isRequired,
|
|
174
181
|
shapes:PropTypes.object.isRequired,
|
|
175
182
|
strokeWidth: PropTypes.number,
|
|
176
|
-
scale: PropTypes.number
|
|
183
|
+
scale: PropTypes.number,
|
|
184
|
+
showCorrect: PropTypes.bool
|
|
177
185
|
};
|
|
178
186
|
|
|
179
187
|
Container.defaultProps = {
|
package/src/hotspot/index.jsx
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import Typography from '@material-ui/core/Typography';
|
|
4
|
+
import CorrectAnswerToggle from '@pie-lib/correct-answer-toggle';
|
|
4
5
|
import {Collapsible, hasText, PreviewPrompt} from '@pie-lib/render-ui';
|
|
5
6
|
import { withStyles } from '@material-ui/core/styles';
|
|
6
7
|
|
|
@@ -71,16 +72,26 @@ class HotspotComponent extends React.Component {
|
|
|
71
72
|
dimensions,
|
|
72
73
|
rationale,
|
|
73
74
|
teacherInstructions,
|
|
74
|
-
strokeWidth
|
|
75
|
+
strokeWidth,
|
|
76
|
+
responseCorrect
|
|
75
77
|
},
|
|
76
78
|
onSelectChoice,
|
|
77
79
|
classes
|
|
78
80
|
} = this.props;
|
|
79
|
-
|
|
81
|
+
const { showCorrect } = this.state;
|
|
80
82
|
const isEvaluateMode = mode === 'evaluate';
|
|
83
|
+
const showCorrectAnswerToggle = isEvaluateMode && !responseCorrect;
|
|
81
84
|
|
|
82
85
|
return (
|
|
83
86
|
<div>
|
|
87
|
+
{showCorrectAnswerToggle && (
|
|
88
|
+
<CorrectAnswerToggle
|
|
89
|
+
show={showCorrectAnswerToggle}
|
|
90
|
+
toggled={showCorrect}
|
|
91
|
+
onToggle={this.onToggle.bind(this)}
|
|
92
|
+
/>
|
|
93
|
+
)}
|
|
94
|
+
{showCorrectAnswerToggle && <br />}
|
|
84
95
|
{
|
|
85
96
|
teacherInstructions && hasText(teacherInstructions) && (
|
|
86
97
|
<Collapsible
|
|
@@ -116,6 +127,7 @@ class HotspotComponent extends React.Component {
|
|
|
116
127
|
disabled={disabled}
|
|
117
128
|
strokeWidth={strokeWidth}
|
|
118
129
|
scale={this.state.scale}
|
|
130
|
+
showCorrect={showCorrect}
|
|
119
131
|
/>
|
|
120
132
|
) : null}
|
|
121
133
|
|
package/src/hotspot/polygon.jsx
CHANGED
|
@@ -51,9 +51,9 @@ class PolygonComponent extends React.Component {
|
|
|
51
51
|
document.body.style.cursor = 'default';
|
|
52
52
|
};
|
|
53
53
|
|
|
54
|
-
getEvaluateOutlineColor = (isCorrect, outlineColor) => isCorrect ? outlineColor : 'red'
|
|
54
|
+
getEvaluateOutlineColor = (isCorrect, markAsCorrect, outlineColor) => markAsCorrect ? 'green' : (isCorrect ? outlineColor : 'red')
|
|
55
55
|
|
|
56
|
-
getOutlineWidth = (selected, strokeWidth) => selected ? strokeWidth : 0;
|
|
56
|
+
getOutlineWidth = (showCorrectEnabled, selected, markAsCorrect, strokeWidth) => markAsCorrect || (!markAsCorrect && !showCorrectEnabled && selected) ? strokeWidth : 0;
|
|
57
57
|
|
|
58
58
|
render() {
|
|
59
59
|
const {
|
|
@@ -66,33 +66,51 @@ class PolygonComponent extends React.Component {
|
|
|
66
66
|
points,
|
|
67
67
|
evaluateText,
|
|
68
68
|
strokeWidth,
|
|
69
|
-
scale
|
|
69
|
+
scale,
|
|
70
|
+
markAsCorrect,
|
|
71
|
+
showCorrectEnabled
|
|
70
72
|
} = this.props;
|
|
71
73
|
|
|
72
74
|
const outlineColorParsed = isEvaluateMode
|
|
73
|
-
? this.getEvaluateOutlineColor(isCorrect, outlineColor)
|
|
75
|
+
? this.getEvaluateOutlineColor(isCorrect, markAsCorrect, outlineColor)
|
|
74
76
|
: outlineColor;
|
|
75
|
-
const outlineWidth = this.getOutlineWidth(selected, strokeWidth);
|
|
77
|
+
const outlineWidth = this.getOutlineWidth(showCorrectEnabled, selected, markAsCorrect, strokeWidth);
|
|
76
78
|
|
|
77
79
|
const pointsParsed = this.parsePointsForKonva(points);
|
|
78
80
|
const center = this.getPolygonCenter(points);
|
|
79
81
|
const iconX = center[0];
|
|
80
82
|
const iconY = center[1];
|
|
81
83
|
|
|
82
|
-
//
|
|
83
|
-
// Correctly
|
|
84
|
-
//
|
|
85
|
-
// Incorrectly
|
|
84
|
+
// "Show Correct Answer" Enabled:
|
|
85
|
+
// - Correctly Selected: white checkmark in green circle
|
|
86
|
+
// - Correctly Not Selected: none
|
|
87
|
+
// - Incorrectly Selected: none
|
|
88
|
+
// - Incorrectly Not Selected: white checkmark in green circle
|
|
89
|
+
// "Show Correct Answer" Disabled:
|
|
90
|
+
// - Correctly Selected:
|
|
91
|
+
// - white checkmark in green circle
|
|
92
|
+
// - heavy outline, as on “Gather”
|
|
93
|
+
// - Correctly Not Selected: none
|
|
94
|
+
// - Incorrectly Selected:
|
|
95
|
+
// - white "X" in red circle
|
|
96
|
+
// - heavy outline around the selection should appear in red
|
|
97
|
+
// - Incorrectly Not Selected: white "X" in red circle
|
|
86
98
|
let iconSrc;
|
|
87
99
|
|
|
88
|
-
if (
|
|
89
|
-
if (isCorrect) {
|
|
100
|
+
if (showCorrectEnabled) {
|
|
101
|
+
if ((selected && isCorrect) || (!selected && !isCorrect)) {
|
|
90
102
|
iconSrc = faCorrect;
|
|
91
|
-
}
|
|
103
|
+
}
|
|
104
|
+
} else {
|
|
105
|
+
if (selected) {
|
|
106
|
+
if (isCorrect) {
|
|
107
|
+
iconSrc = faCorrect;
|
|
108
|
+
} else {
|
|
109
|
+
iconSrc = faWrong;
|
|
110
|
+
}
|
|
111
|
+
} else if (!isCorrect) {
|
|
92
112
|
iconSrc = faWrong;
|
|
93
113
|
}
|
|
94
|
-
} else if (!isCorrect) {
|
|
95
|
-
iconSrc = faWrong;
|
|
96
114
|
}
|
|
97
115
|
|
|
98
116
|
return (
|
|
@@ -144,7 +162,9 @@ PolygonComponent.propTypes = {
|
|
|
144
162
|
selected: PropTypes.bool.isRequired,
|
|
145
163
|
evaluateText: PropTypes.string,
|
|
146
164
|
strokeWidth: PropTypes.number,
|
|
147
|
-
scale: PropTypes.number
|
|
165
|
+
scale: PropTypes.number,
|
|
166
|
+
markAsCorrect: PropTypes.bool.isRequired,
|
|
167
|
+
showCorrectEnabled: PropTypes.bool.isRequired
|
|
148
168
|
};
|
|
149
169
|
|
|
150
170
|
PolygonComponent.defaultProps = {
|
|
@@ -32,9 +32,9 @@ class RectComponent extends React.Component {
|
|
|
32
32
|
document.body.style.cursor = 'default';
|
|
33
33
|
};
|
|
34
34
|
|
|
35
|
-
getEvaluateOutlineColor = (isCorrect, outlineColor) => isCorrect ? outlineColor : 'red'
|
|
35
|
+
getEvaluateOutlineColor = (isCorrect, markAsCorrect, outlineColor) => markAsCorrect ? 'green' : (isCorrect ? outlineColor : 'red')
|
|
36
36
|
|
|
37
|
-
getOutlineWidth = (selected, strokeWidth) => selected ? strokeWidth : 0;
|
|
37
|
+
getOutlineWidth = (showCorrectEnabled, selected, markAsCorrect, strokeWidth) => markAsCorrect || (!markAsCorrect && !showCorrectEnabled && selected) ? strokeWidth : 0;
|
|
38
38
|
|
|
39
39
|
render() {
|
|
40
40
|
const {
|
|
@@ -50,32 +50,50 @@ class RectComponent extends React.Component {
|
|
|
50
50
|
y,
|
|
51
51
|
evaluateText,
|
|
52
52
|
strokeWidth,
|
|
53
|
-
scale
|
|
53
|
+
scale,
|
|
54
|
+
markAsCorrect,
|
|
55
|
+
showCorrectEnabled
|
|
54
56
|
} = this.props;
|
|
55
57
|
|
|
56
58
|
const outlineColorParsed = isEvaluateMode
|
|
57
|
-
? this.getEvaluateOutlineColor(isCorrect, outlineColor)
|
|
59
|
+
? this.getEvaluateOutlineColor(isCorrect, markAsCorrect, outlineColor)
|
|
58
60
|
: outlineColor;
|
|
59
61
|
|
|
60
|
-
const outlineWidth = this.getOutlineWidth(selected, strokeWidth);
|
|
62
|
+
const outlineWidth = this.getOutlineWidth(showCorrectEnabled, selected, markAsCorrect, strokeWidth);
|
|
61
63
|
|
|
62
64
|
const iconX = (x + (width / 2)) - 10;
|
|
63
65
|
const iconY = (y + (height / 2)) - 10;
|
|
64
66
|
|
|
65
|
-
//
|
|
66
|
-
// Correctly
|
|
67
|
-
//
|
|
68
|
-
// Incorrectly
|
|
67
|
+
// "Show Correct Answer" Enabled:
|
|
68
|
+
// - Correctly Selected: white checkmark in green circle
|
|
69
|
+
// - Correctly Not Selected: none
|
|
70
|
+
// - Incorrectly Selected: none
|
|
71
|
+
// - Incorrectly Not Selected: white checkmark in green circle
|
|
72
|
+
// "Show Correct Answer" Disabled:
|
|
73
|
+
// - Correctly Selected:
|
|
74
|
+
// - white checkmark in green circle
|
|
75
|
+
// - heavy outline, as on “Gather”
|
|
76
|
+
// - Correctly Not Selected: none
|
|
77
|
+
// - Incorrectly Selected:
|
|
78
|
+
// - white "X" in red circle
|
|
79
|
+
// - heavy outline around the selection should appear in red
|
|
80
|
+
// - Incorrectly Not Selected: white "X" in red circle
|
|
69
81
|
let iconSrc;
|
|
70
82
|
|
|
71
|
-
if (
|
|
72
|
-
if (isCorrect) {
|
|
83
|
+
if (showCorrectEnabled) {
|
|
84
|
+
if ((selected && isCorrect) || (!selected && !isCorrect)) {
|
|
73
85
|
iconSrc = faCorrect;
|
|
74
|
-
}
|
|
86
|
+
}
|
|
87
|
+
} else {
|
|
88
|
+
if (selected) {
|
|
89
|
+
if (isCorrect) {
|
|
90
|
+
iconSrc = faCorrect;
|
|
91
|
+
} else {
|
|
92
|
+
iconSrc = faWrong;
|
|
93
|
+
}
|
|
94
|
+
} else if (!isCorrect) {
|
|
75
95
|
iconSrc = faWrong;
|
|
76
96
|
}
|
|
77
|
-
} else if (!isCorrect) {
|
|
78
|
-
iconSrc = faWrong;
|
|
79
97
|
}
|
|
80
98
|
|
|
81
99
|
return (
|
|
@@ -132,7 +150,9 @@ RectComponent.propTypes = {
|
|
|
132
150
|
y: PropTypes.number.isRequired,
|
|
133
151
|
evaluateText: PropTypes.string,
|
|
134
152
|
strokeWidth: PropTypes.number,
|
|
135
|
-
scale: PropTypes.number
|
|
153
|
+
scale: PropTypes.number,
|
|
154
|
+
markAsCorrect: PropTypes.bool.isRequired,
|
|
155
|
+
showCorrectEnabled: PropTypes.bool.isRequired
|
|
136
156
|
};
|
|
137
157
|
|
|
138
158
|
RectComponent.defaultProps = {
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
-
|
|
3
|
-
exports[`Image snapshots image renders 1`] = `
|
|
4
|
-
<Image
|
|
5
|
-
height={20}
|
|
6
|
-
image={null}
|
|
7
|
-
width={20}
|
|
8
|
-
x={5}
|
|
9
|
-
y={5}
|
|
10
|
-
/>
|
|
11
|
-
`;
|
|
12
|
-
|
|
13
|
-
exports[`Image snapshots x y position renders 1`] = `
|
|
14
|
-
<Image
|
|
15
|
-
height={20}
|
|
16
|
-
image={null}
|
|
17
|
-
width={20}
|
|
18
|
-
x={10}
|
|
19
|
-
y={10}
|
|
20
|
-
/>
|
|
21
|
-
`;
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import _ from 'lodash';
|
|
3
|
-
import { shallow } from 'enzyme';
|
|
4
|
-
import toJson from 'enzyme-to-json';
|
|
5
|
-
import Konva from 'konva';
|
|
6
|
-
|
|
7
|
-
import Polygon from '../hotspot/polygon';
|
|
8
|
-
|
|
9
|
-
Konva.isBrowser = false;
|
|
10
|
-
|
|
11
|
-
describe('Polygon', () => {
|
|
12
|
-
let onClick, wrapper;
|
|
13
|
-
|
|
14
|
-
const mkWrapper = (opts = {}) => {
|
|
15
|
-
opts = _.extend(
|
|
16
|
-
{
|
|
17
|
-
classes: {
|
|
18
|
-
base: 'base'
|
|
19
|
-
},
|
|
20
|
-
height: 200,
|
|
21
|
-
hotspotColor: 'rgba(137, 183, 244, 0.65)',
|
|
22
|
-
id: '1',
|
|
23
|
-
isCorrect: false,
|
|
24
|
-
isEvaluateMode: false,
|
|
25
|
-
evaluateText: null,
|
|
26
|
-
disabled: false,
|
|
27
|
-
outlineColor: 'blue',
|
|
28
|
-
selected: false,
|
|
29
|
-
points: [{ x: 94, y: 4 }, { x: 89, y: 4 }, { x: 36, y: 40 }]
|
|
30
|
-
},
|
|
31
|
-
opts
|
|
32
|
-
);
|
|
33
|
-
|
|
34
|
-
return shallow(<Polygon {...opts} onClick={onClick} />);
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
beforeEach(() => {
|
|
38
|
-
onClick = jest.fn();
|
|
39
|
-
wrapper = mkWrapper();
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
describe('snapshots', () => {
|
|
43
|
-
describe('outline color', () => {
|
|
44
|
-
it('renders', () => {
|
|
45
|
-
const wrapper = mkWrapper({ outlineColor: 'red' });
|
|
46
|
-
expect(toJson(wrapper)).toMatchSnapshot();
|
|
47
|
-
});
|
|
48
|
-
});
|
|
49
|
-
|
|
50
|
-
describe('outline width', () => {
|
|
51
|
-
it('renders with default border width', () => {
|
|
52
|
-
const wrapper = mkWrapper();
|
|
53
|
-
expect(toJson(wrapper)).toMatchSnapshot();
|
|
54
|
-
});
|
|
55
|
-
|
|
56
|
-
it('renders with given border width', () => {
|
|
57
|
-
const wrapper = mkWrapper({ strokeWidth: 10 });
|
|
58
|
-
expect(toJson(wrapper)).toMatchSnapshot();
|
|
59
|
-
});
|
|
60
|
-
});
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
describe('hotspot color', () => {
|
|
64
|
-
it('renders', () => {
|
|
65
|
-
const wrapper = mkWrapper({ hotspotColor: 'rgba(217, 30, 24, 0.65)' });
|
|
66
|
-
expect(toJson(wrapper)).toMatchSnapshot();
|
|
67
|
-
});
|
|
68
|
-
});
|
|
69
|
-
|
|
70
|
-
describe('evaluate with correct answer', () => {
|
|
71
|
-
it('renders', () => {
|
|
72
|
-
const wrapper = mkWrapper({ isEvaluateMode: true, isCorrect: true, evaluateText: 'Correctly\nselected' });
|
|
73
|
-
expect(toJson(wrapper)).toMatchSnapshot();
|
|
74
|
-
});
|
|
75
|
-
});
|
|
76
|
-
});
|
|
77
|
-
});
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import _ from 'lodash';
|
|
3
|
-
import { shallow } from 'enzyme';
|
|
4
|
-
import toJson from 'enzyme-to-json';
|
|
5
|
-
import Konva from 'konva';
|
|
6
|
-
|
|
7
|
-
import Rectangle from '../hotspot/rectangle';
|
|
8
|
-
|
|
9
|
-
Konva.isBrowser = false;
|
|
10
|
-
|
|
11
|
-
describe('Rectangle', () => {
|
|
12
|
-
let onClick, wrapper;
|
|
13
|
-
|
|
14
|
-
const mkWrapper = (opts = {}) => {
|
|
15
|
-
opts = _.extend(
|
|
16
|
-
{
|
|
17
|
-
classes: {
|
|
18
|
-
base: 'base'
|
|
19
|
-
},
|
|
20
|
-
height: 200,
|
|
21
|
-
hotspotColor: 'rgba(137, 183, 244, 0.65)',
|
|
22
|
-
id: '1',
|
|
23
|
-
isCorrect: false,
|
|
24
|
-
isEvaluateMode: false,
|
|
25
|
-
evaluateText: null,
|
|
26
|
-
disabled: false,
|
|
27
|
-
outlineColor: 'blue',
|
|
28
|
-
selected: false,
|
|
29
|
-
width: 300,
|
|
30
|
-
x: 5,
|
|
31
|
-
y: 5
|
|
32
|
-
},
|
|
33
|
-
opts
|
|
34
|
-
);
|
|
35
|
-
|
|
36
|
-
return shallow(<Rectangle {...opts} onClick={onClick} />);
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
beforeEach(() => {
|
|
40
|
-
onClick = jest.fn();
|
|
41
|
-
wrapper = mkWrapper();
|
|
42
|
-
});
|
|
43
|
-
|
|
44
|
-
describe('snapshots', () => {
|
|
45
|
-
describe('outline color', () => {
|
|
46
|
-
it('renders', () => {
|
|
47
|
-
const wrapper = mkWrapper({ outlineColor: 'red' });
|
|
48
|
-
expect(toJson(wrapper)).toMatchSnapshot();
|
|
49
|
-
});
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
describe('outline width', () => {
|
|
53
|
-
it('renders with default border width', () => {
|
|
54
|
-
const wrapper = mkWrapper();
|
|
55
|
-
expect(toJson(wrapper)).toMatchSnapshot();
|
|
56
|
-
});
|
|
57
|
-
|
|
58
|
-
it('renders with given border width', () => {
|
|
59
|
-
const wrapper = mkWrapper({ strokeWidth: 10 });
|
|
60
|
-
expect(toJson(wrapper)).toMatchSnapshot();
|
|
61
|
-
});
|
|
62
|
-
});
|
|
63
|
-
|
|
64
|
-
describe('hotspot color', () => {
|
|
65
|
-
it('renders', () => {
|
|
66
|
-
const wrapper = mkWrapper({ hotspotColor: 'rgba(217, 30, 24, 0.65)' });
|
|
67
|
-
expect(toJson(wrapper)).toMatchSnapshot();
|
|
68
|
-
});
|
|
69
|
-
});
|
|
70
|
-
|
|
71
|
-
describe('evaluate with correct answer', () => {
|
|
72
|
-
it('renders', () => {
|
|
73
|
-
const wrapper = mkWrapper({ isEvaluateMode: true, isCorrect: true, evaluateText: 'Correctly\nselected' });
|
|
74
|
-
expect(toJson(wrapper)).toMatchSnapshot();
|
|
75
|
-
});
|
|
76
|
-
});
|
|
77
|
-
});
|
|
78
|
-
});
|