@pie-lib/mask-markup 3.0.13 → 3.1.0-beta

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.
@@ -0,0 +1,202 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ var _typeof = require("@babel/runtime/helpers/typeof");
5
+ var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
6
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
7
+ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
8
+ var React = _interopRequireWildcard(require("react"));
9
+ var _react2 = require("@testing-library/react");
10
+ var _userEvent = _interopRequireDefault(require("@testing-library/user-event"));
11
+ var _utils = require("../../__tests__/utils");
12
+ var _dropdown = _interopRequireDefault(require("../dropdown"));
13
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
14
+ describe('Dropdown', function () {
15
+ var onChange = jest.fn();
16
+ var defaultProps = {
17
+ onChange: onChange,
18
+ id: '1',
19
+ correct: false,
20
+ disabled: false,
21
+ value: 'Jumped',
22
+ choices: [(0, _utils.choice)('Jumped'), (0, _utils.choice)('Laughed'), (0, _utils.choice)('Smiled')]
23
+ };
24
+ beforeEach(function () {
25
+ onChange.mockClear();
26
+ });
27
+ describe('rendering', function () {
28
+ it('renders dropdown with default props', function () {
29
+ (0, _react2.render)(/*#__PURE__*/React.createElement(_dropdown["default"], defaultProps));
30
+ var button = _react2.screen.getByRole('combobox');
31
+ expect(button).toBeInTheDocument();
32
+ // Button displays the selected value
33
+ expect(button).toHaveTextContent('Jumped');
34
+ });
35
+ it('renders with all choices as options when opened', /*#__PURE__*/(0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee() {
36
+ var user, button, options;
37
+ return _regenerator["default"].wrap(function (_context) {
38
+ while (1) switch (_context.prev = _context.next) {
39
+ case 0:
40
+ user = _userEvent["default"].setup();
41
+ (0, _react2.render)(/*#__PURE__*/React.createElement(_dropdown["default"], defaultProps));
42
+ button = _react2.screen.getByRole('combobox');
43
+ _context.next = 1;
44
+ return user.click(button);
45
+ case 1:
46
+ // Options should now be visible - find them by role
47
+ options = _react2.screen.getAllByRole('option');
48
+ expect(options).toHaveLength(3);
49
+ // Verify the text content of options using specific elements
50
+ expect(options[0]).toHaveTextContent('Jumped');
51
+ expect(options[1]).toHaveTextContent('Laughed');
52
+ expect(options[2]).toHaveTextContent('Smiled');
53
+ case 2:
54
+ case "end":
55
+ return _context.stop();
56
+ }
57
+ }, _callee);
58
+ })));
59
+ it('focuses the selected option when the menu opens', /*#__PURE__*/(0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee2() {
60
+ var user, button;
61
+ return _regenerator["default"].wrap(function (_context2) {
62
+ while (1) switch (_context2.prev = _context2.next) {
63
+ case 0:
64
+ user = _userEvent["default"].setup();
65
+ (0, _react2.render)(/*#__PURE__*/React.createElement(_dropdown["default"], defaultProps));
66
+ button = _react2.screen.getByRole('combobox');
67
+ _context2.next = 1;
68
+ return user.click(button);
69
+ case 1:
70
+ _context2.next = 2;
71
+ return (0, _react2.waitFor)(function () {
72
+ expect(document.getElementById('dropdown-option-1-0')).toHaveFocus();
73
+ });
74
+ case 2:
75
+ expect(button).toHaveAttribute('aria-activedescendant', 'dropdown-option-1-0');
76
+ case 3:
77
+ case "end":
78
+ return _context2.stop();
79
+ }
80
+ }, _callee2);
81
+ })));
82
+ it('focuses a non-first selected option when the menu opens', /*#__PURE__*/(0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee3() {
83
+ var user, button;
84
+ return _regenerator["default"].wrap(function (_context3) {
85
+ while (1) switch (_context3.prev = _context3.next) {
86
+ case 0:
87
+ user = _userEvent["default"].setup();
88
+ (0, _react2.render)(/*#__PURE__*/React.createElement(_dropdown["default"], (0, _extends2["default"])({}, defaultProps, {
89
+ value: "Laughed"
90
+ })));
91
+ button = _react2.screen.getByRole('combobox');
92
+ _context3.next = 1;
93
+ return user.click(button);
94
+ case 1:
95
+ _context3.next = 2;
96
+ return (0, _react2.waitFor)(function () {
97
+ expect(document.getElementById('dropdown-option-1-1')).toHaveFocus();
98
+ });
99
+ case 2:
100
+ expect(button).toHaveAttribute('aria-activedescendant', 'dropdown-option-1-1');
101
+ case 3:
102
+ case "end":
103
+ return _context3.stop();
104
+ }
105
+ }, _callee3);
106
+ })));
107
+ it('does not highlight an option when no value is selected', /*#__PURE__*/(0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee4() {
108
+ var user, button;
109
+ return _regenerator["default"].wrap(function (_context4) {
110
+ while (1) switch (_context4.prev = _context4.next) {
111
+ case 0:
112
+ user = _userEvent["default"].setup();
113
+ (0, _react2.render)(/*#__PURE__*/React.createElement(_dropdown["default"], (0, _extends2["default"])({}, defaultProps, {
114
+ value: undefined
115
+ })));
116
+ button = _react2.screen.getByRole('combobox');
117
+ _context4.next = 1;
118
+ return user.click(button);
119
+ case 1:
120
+ expect(button).not.toHaveAttribute('aria-activedescendant');
121
+ case 2:
122
+ case "end":
123
+ return _context4.stop();
124
+ }
125
+ }, _callee4);
126
+ })));
127
+ it('renders as disabled when disabled prop is true', function () {
128
+ (0, _react2.render)(/*#__PURE__*/React.createElement(_dropdown["default"], (0, _extends2["default"])({}, defaultProps, {
129
+ disabled: true
130
+ })));
131
+ var button = _react2.screen.getByRole('combobox');
132
+ expect(button).toBeDisabled();
133
+ });
134
+ it('shows correct state when correct is true', function () {
135
+ var _render = (0, _react2.render)(/*#__PURE__*/React.createElement(_dropdown["default"], (0, _extends2["default"])({}, defaultProps, {
136
+ correct: true
137
+ }))),
138
+ container = _render.container;
139
+ var button = _react2.screen.getByRole('combobox');
140
+ expect(button).toBeInTheDocument();
141
+ });
142
+ });
143
+ describe('user interactions', function () {
144
+ it('calls onChange when user selects a different option', /*#__PURE__*/(0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee5() {
145
+ var user, button, options, laughedOption;
146
+ return _regenerator["default"].wrap(function (_context5) {
147
+ while (1) switch (_context5.prev = _context5.next) {
148
+ case 0:
149
+ user = _userEvent["default"].setup();
150
+ (0, _react2.render)(/*#__PURE__*/React.createElement(_dropdown["default"], defaultProps));
151
+
152
+ // Click button to open menu
153
+ button = _react2.screen.getByRole('combobox');
154
+ _context5.next = 1;
155
+ return user.click(button);
156
+ case 1:
157
+ // Find the option by getting all options and selecting the one with "Laughed" text
158
+ options = _react2.screen.getAllByRole('option');
159
+ laughedOption = options.find(function (opt) {
160
+ return opt.textContent.includes('Laughed');
161
+ });
162
+ _context5.next = 2;
163
+ return user.click(laughedOption);
164
+ case 2:
165
+ expect(onChange).toHaveBeenCalledWith('1', 'Laughed');
166
+ case 3:
167
+ case "end":
168
+ return _context5.stop();
169
+ }
170
+ }, _callee5);
171
+ })));
172
+ it('calls onChange with correct value', /*#__PURE__*/(0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee6() {
173
+ var user, button, options, smiledOption;
174
+ return _regenerator["default"].wrap(function (_context6) {
175
+ while (1) switch (_context6.prev = _context6.next) {
176
+ case 0:
177
+ user = _userEvent["default"].setup();
178
+ (0, _react2.render)(/*#__PURE__*/React.createElement(_dropdown["default"], defaultProps));
179
+
180
+ // Click button to open menu
181
+ button = _react2.screen.getByRole('combobox');
182
+ _context6.next = 1;
183
+ return user.click(button);
184
+ case 1:
185
+ // Find the option by getting all options and selecting the one with "Smiled" text
186
+ options = _react2.screen.getAllByRole('option');
187
+ smiledOption = options.find(function (opt) {
188
+ return opt.textContent.includes('Smiled');
189
+ });
190
+ _context6.next = 2;
191
+ return user.click(smiledOption);
192
+ case 2:
193
+ expect(onChange).toHaveBeenCalledWith('1', 'Smiled');
194
+ case 3:
195
+ case "end":
196
+ return _context6.stop();
197
+ }
198
+ }, _callee6);
199
+ })));
200
+ });
201
+ });
202
+ //# sourceMappingURL=dropdown.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dropdown.test.js","names":["React","_interopRequireWildcard","require","_react2","_userEvent","_interopRequireDefault","_utils","_dropdown","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","_typeof","has","get","set","_t","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","describe","onChange","jest","fn","defaultProps","id","correct","disabled","value","choices","choice","beforeEach","mockClear","it","render","createElement","button","screen","getByRole","expect","toBeInTheDocument","toHaveTextContent","_asyncToGenerator2","_regenerator","mark","_callee","user","options","wrap","_context","prev","next","userEvent","setup","click","getAllByRole","toHaveLength","stop","_callee2","_context2","waitFor","document","getElementById","toHaveFocus","toHaveAttribute","_callee3","_context3","_extends2","_callee4","_context4","undefined","not","toBeDisabled","_render","container","_callee5","laughedOption","_context5","find","opt","textContent","includes","toHaveBeenCalledWith","_callee6","smiledOption","_context6"],"sources":["../../../src/components/__tests__/dropdown.test.js"],"sourcesContent":["import * as React from 'react';\nimport { render, screen, waitFor } from '@testing-library/react';\nimport userEvent from '@testing-library/user-event';\nimport { choice } from '../../__tests__/utils';\nimport Dropdown from '../dropdown';\n\ndescribe('Dropdown', () => {\n const onChange = jest.fn();\n const defaultProps = {\n onChange,\n id: '1',\n correct: false,\n disabled: false,\n value: 'Jumped',\n choices: [choice('Jumped'), choice('Laughed'), choice('Smiled')],\n };\n\n beforeEach(() => {\n onChange.mockClear();\n });\n\n describe('rendering', () => {\n it('renders dropdown with default props', () => {\n render(<Dropdown {...defaultProps} />);\n const button = screen.getByRole('combobox');\n expect(button).toBeInTheDocument();\n // Button displays the selected value\n expect(button).toHaveTextContent('Jumped');\n });\n\n it('renders with all choices as options when opened', async () => {\n const user = userEvent.setup();\n render(<Dropdown {...defaultProps} />);\n\n const button = screen.getByRole('combobox');\n await user.click(button);\n\n // Options should now be visible - find them by role\n const options = screen.getAllByRole('option');\n expect(options).toHaveLength(3);\n // Verify the text content of options using specific elements\n expect(options[0]).toHaveTextContent('Jumped');\n expect(options[1]).toHaveTextContent('Laughed');\n expect(options[2]).toHaveTextContent('Smiled');\n });\n\n it('focuses the selected option when the menu opens', async () => {\n const user = userEvent.setup();\n render(<Dropdown {...defaultProps} />);\n\n const button = screen.getByRole('combobox');\n await user.click(button);\n\n await waitFor(() => {\n expect(document.getElementById('dropdown-option-1-0')).toHaveFocus();\n });\n expect(button).toHaveAttribute('aria-activedescendant', 'dropdown-option-1-0');\n });\n\n it('focuses a non-first selected option when the menu opens', async () => {\n const user = userEvent.setup();\n render(<Dropdown {...defaultProps} value=\"Laughed\" />);\n\n const button = screen.getByRole('combobox');\n await user.click(button);\n\n await waitFor(() => {\n expect(document.getElementById('dropdown-option-1-1')).toHaveFocus();\n });\n expect(button).toHaveAttribute('aria-activedescendant', 'dropdown-option-1-1');\n });\n\n it('does not highlight an option when no value is selected', async () => {\n const user = userEvent.setup();\n render(<Dropdown {...defaultProps} value={undefined} />);\n\n const button = screen.getByRole('combobox');\n await user.click(button);\n\n expect(button).not.toHaveAttribute('aria-activedescendant');\n });\n\n it('renders as disabled when disabled prop is true', () => {\n render(<Dropdown {...defaultProps} disabled={true} />);\n const button = screen.getByRole('combobox');\n expect(button).toBeDisabled();\n });\n\n it('shows correct state when correct is true', () => {\n const { container } = render(<Dropdown {...defaultProps} correct={true} />);\n const button = screen.getByRole('combobox');\n expect(button).toBeInTheDocument();\n });\n });\n\n describe('user interactions', () => {\n it('calls onChange when user selects a different option', async () => {\n const user = userEvent.setup();\n render(<Dropdown {...defaultProps} />);\n\n // Click button to open menu\n const button = screen.getByRole('combobox');\n await user.click(button);\n\n // Find the option by getting all options and selecting the one with \"Laughed\" text\n const options = screen.getAllByRole('option');\n const laughedOption = options.find((opt) => opt.textContent.includes('Laughed'));\n await user.click(laughedOption);\n\n expect(onChange).toHaveBeenCalledWith('1', 'Laughed');\n });\n\n it('calls onChange with correct value', async () => {\n const user = userEvent.setup();\n render(<Dropdown {...defaultProps} />);\n\n // Click button to open menu\n const button = screen.getByRole('combobox');\n await user.click(button);\n\n // Find the option by getting all options and selecting the one with \"Smiled\" text\n const options = screen.getAllByRole('option');\n const smiledOption = options.find((opt) => opt.textContent.includes('Smiled'));\n await user.click(smiledOption);\n\n expect(onChange).toHaveBeenCalledWith('1', 'Smiled');\n });\n });\n});\n"],"mappings":";;;;;;;AAAA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,SAAA,GAAAF,sBAAA,CAAAH,OAAA;AAAmC,SAAAD,wBAAAO,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAT,uBAAA,YAAAA,wBAAAO,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,mBAAAT,CAAA,iBAAAA,CAAA,gBAAAU,OAAA,CAAAV,CAAA,0BAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,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,CAAC,UAACC,GAAG;cAAA,OAAKA,GAAG,CAACC,WAAW,CAACC,QAAQ,CAAC,QAAQ,CAAC;YAAA,EAAC;YAAAI,SAAA,CAAAlC,IAAA;YAAA,OACxEL,IAAI,CAACQ,KAAK,CAAC8B,YAAY,CAAC;UAAA;YAE9B7C,MAAM,CAAClB,QAAQ,CAAC,CAAC6D,oBAAoB,CAAC,GAAG,EAAE,QAAQ,CAAC;UAAC;UAAA;YAAA,OAAAG,SAAA,CAAA5B,IAAA;QAAA;MAAA,GAAA0B,QAAA;IAAA,CACtD,GAAC;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,129 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ var _typeof = require("@babel/runtime/helpers/typeof");
5
+ var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
6
+ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
7
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
8
+ var React = _interopRequireWildcard(require("react"));
9
+ var _react2 = require("@testing-library/react");
10
+ var _userEvent = _interopRequireDefault(require("@testing-library/user-event"));
11
+ var _input = _interopRequireDefault(require("../input"));
12
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
13
+ // Mock CorrectInput to simplify testing
14
+ jest.mock('../correct-input', function () {
15
+ return function CorrectInput(_ref) {
16
+ var value = _ref.value,
17
+ onChange = _ref.onChange,
18
+ disabled = _ref.disabled,
19
+ correct = _ref.correct,
20
+ variant = _ref.variant;
21
+ return /*#__PURE__*/React.createElement("input", {
22
+ "data-testid": "correct-input",
23
+ value: value || '',
24
+ onChange: onChange,
25
+ disabled: disabled,
26
+ "data-correct": correct,
27
+ "data-variant": variant
28
+ });
29
+ };
30
+ });
31
+ describe('Input', function () {
32
+ var onChange = jest.fn();
33
+ var defaultProps = {
34
+ disabled: false,
35
+ correct: false,
36
+ value: 'Cow',
37
+ id: '1',
38
+ onChange: onChange
39
+ };
40
+ beforeEach(function () {
41
+ onChange.mockClear();
42
+ });
43
+ describe('rendering', function () {
44
+ it('renders with default props', function () {
45
+ (0, _react2.render)(/*#__PURE__*/React.createElement(_input["default"], defaultProps));
46
+ var input = _react2.screen.getByTestId('correct-input');
47
+ expect(input).toBeInTheDocument();
48
+ expect(input).toHaveValue('Cow');
49
+ expect(input).not.toBeDisabled();
50
+ expect(input).toHaveAttribute('data-correct', 'false');
51
+ });
52
+ it('renders as disabled when disabled prop is true', function () {
53
+ (0, _react2.render)(/*#__PURE__*/React.createElement(_input["default"], (0, _extends2["default"])({}, defaultProps, {
54
+ disabled: true
55
+ })));
56
+ var input = _react2.screen.getByTestId('correct-input');
57
+ expect(input).toBeDisabled();
58
+ });
59
+ it('renders with correct state', function () {
60
+ (0, _react2.render)(/*#__PURE__*/React.createElement(_input["default"], (0, _extends2["default"])({}, defaultProps, {
61
+ correct: true
62
+ })));
63
+ var input = _react2.screen.getByTestId('correct-input');
64
+ expect(input).toHaveAttribute('data-correct', 'true');
65
+ });
66
+ it('shows correct answer when showCorrectAnswer is true', function () {
67
+ (0, _react2.render)(/*#__PURE__*/React.createElement(_input["default"], (0, _extends2["default"])({}, defaultProps, {
68
+ showCorrectAnswer: true
69
+ })));
70
+ var input = _react2.screen.getByTestId('correct-input');
71
+ expect(input).toHaveAttribute('data-correct', 'true');
72
+ });
73
+ });
74
+ describe('user interactions', function () {
75
+ it('calls onChange with id and value when user types', /*#__PURE__*/(0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee() {
76
+ var user, input;
77
+ return _regenerator["default"].wrap(function (_context) {
78
+ while (1) switch (_context.prev = _context.next) {
79
+ case 0:
80
+ user = _userEvent["default"].setup();
81
+ (0, _react2.render)(/*#__PURE__*/React.createElement(_input["default"], (0, _extends2["default"])({}, defaultProps, {
82
+ value: ""
83
+ })));
84
+ input = _react2.screen.getByTestId('correct-input');
85
+ _context.next = 1;
86
+ return user.type(input, '20');
87
+ case 1:
88
+ // userEvent.type types character by character, so onChange is called for each character
89
+ expect(onChange).toHaveBeenCalled();
90
+ expect(onChange).toHaveBeenCalledTimes(2);
91
+ // Check the last call has both characters
92
+ expect(onChange).toHaveBeenLastCalledWith('1', '0');
93
+ case 2:
94
+ case "end":
95
+ return _context.stop();
96
+ }
97
+ }, _callee);
98
+ })));
99
+ it('calls onChange with updated value', /*#__PURE__*/(0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee2() {
100
+ var user, input;
101
+ return _regenerator["default"].wrap(function (_context2) {
102
+ while (1) switch (_context2.prev = _context2.next) {
103
+ case 0:
104
+ user = _userEvent["default"].setup();
105
+ (0, _react2.render)(/*#__PURE__*/React.createElement(_input["default"], defaultProps));
106
+ input = _react2.screen.getByTestId('correct-input');
107
+ _context2.next = 1;
108
+ return user.clear(input);
109
+ case 1:
110
+ _context2.next = 2;
111
+ return user.type(input, 'New Value');
112
+ case 2:
113
+ // userEvent.type types character by character
114
+ // After clear, we start with empty string, and each character is typed
115
+ // The last call should have the full accumulated value up to the last character
116
+ expect(onChange).toHaveBeenCalled();
117
+ // With clear + "New Value", onChange is called for clearing ("") and each typed character
118
+ // The value accumulated in the input element after typing will be "CowNew Value"
119
+ // because the component starts with value="Cow" and we clear then type
120
+ expect(onChange.mock.calls.length).toBeGreaterThan(0);
121
+ case 3:
122
+ case "end":
123
+ return _context2.stop();
124
+ }
125
+ }, _callee2);
126
+ })));
127
+ });
128
+ });
129
+ //# sourceMappingURL=input.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"input.test.js","names":["React","_interopRequireWildcard","require","_react2","_userEvent","_interopRequireDefault","_input","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","_typeof","has","get","set","_t","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","jest","mock","CorrectInput","_ref","value","onChange","disabled","correct","variant","createElement","describe","fn","defaultProps","id","beforeEach","mockClear","it","render","input","screen","getByTestId","expect","toBeInTheDocument","toHaveValue","not","toBeDisabled","toHaveAttribute","_extends2","showCorrectAnswer","_asyncToGenerator2","_regenerator","mark","_callee","user","wrap","_context","prev","next","userEvent","setup","type","toHaveBeenCalled","toHaveBeenCalledTimes","toHaveBeenLastCalledWith","stop","_callee2","_context2","clear","calls","length","toBeGreaterThan"],"sources":["../../../src/components/__tests__/input.test.js"],"sourcesContent":["import * as React from 'react';\nimport { render, screen } from '@testing-library/react';\nimport userEvent from '@testing-library/user-event';\nimport Input from '../input';\n\n// Mock CorrectInput to simplify testing\njest.mock('../correct-input', () => {\n return function CorrectInput({ value, onChange, disabled, correct, variant }) {\n return (\n <input\n data-testid=\"correct-input\"\n value={value || ''}\n onChange={onChange}\n disabled={disabled}\n data-correct={correct}\n data-variant={variant}\n />\n );\n };\n});\n\ndescribe('Input', () => {\n const onChange = jest.fn();\n const defaultProps = {\n disabled: false,\n correct: false,\n value: 'Cow',\n id: '1',\n onChange,\n };\n\n beforeEach(() => {\n onChange.mockClear();\n });\n\n describe('rendering', () => {\n it('renders with default props', () => {\n render(<Input {...defaultProps} />);\n const input = screen.getByTestId('correct-input');\n\n expect(input).toBeInTheDocument();\n expect(input).toHaveValue('Cow');\n expect(input).not.toBeDisabled();\n expect(input).toHaveAttribute('data-correct', 'false');\n });\n\n it('renders as disabled when disabled prop is true', () => {\n render(<Input {...defaultProps} disabled={true} />);\n const input = screen.getByTestId('correct-input');\n\n expect(input).toBeDisabled();\n });\n\n it('renders with correct state', () => {\n render(<Input {...defaultProps} correct={true} />);\n const input = screen.getByTestId('correct-input');\n\n expect(input).toHaveAttribute('data-correct', 'true');\n });\n\n it('shows correct answer when showCorrectAnswer is true', () => {\n render(<Input {...defaultProps} showCorrectAnswer={true} />);\n const input = screen.getByTestId('correct-input');\n\n expect(input).toHaveAttribute('data-correct', 'true');\n });\n });\n\n describe('user interactions', () => {\n it('calls onChange with id and value when user types', async () => {\n const user = userEvent.setup();\n render(<Input {...defaultProps} value=\"\" />);\n\n const input = screen.getByTestId('correct-input');\n await user.type(input, '20');\n\n // userEvent.type types character by character, so onChange is called for each character\n expect(onChange).toHaveBeenCalled();\n expect(onChange).toHaveBeenCalledTimes(2);\n // Check the last call has both characters\n expect(onChange).toHaveBeenLastCalledWith('1', '0');\n });\n\n it('calls onChange with updated value', async () => {\n const user = userEvent.setup();\n render(<Input {...defaultProps} />);\n\n const input = screen.getByTestId('correct-input');\n await user.clear(input);\n await user.type(input, 'New Value');\n\n // userEvent.type types character by character\n // After clear, we start with empty string, and each character is typed\n // The last call should have the full accumulated value up to the last character\n expect(onChange).toHaveBeenCalled();\n // With clear + \"New Value\", onChange is called for clearing (\"\") and each typed character\n // The value accumulated in the input element after typing will be \"CowNew Value\"\n // because the component starts with value=\"Cow\" and we clear then type\n expect(onChange.mock.calls.length).toBeGreaterThan(0);\n });\n });\n});\n"],"mappings":";;;;;;;AAAA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,MAAA,GAAAD,sBAAA,CAAAH,OAAA;AAA6B,SAAAD,wBAAAM,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAR,uBAAA,YAAAA,wBAAAM,CAAA,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AAK,CAACC,MAAM,CAAC,CAACC,eAAe,CAAC,CAAC,CAAC;UAAC;UAAA;YAAA,OAAAJ,SAAA,CAAAF,IAAA;QAAA;MAAA,GAAAC,QAAA;IAAA,CACvD,GAAC;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pie-lib/mask-markup",
3
- "version": "3.0.13",
3
+ "version": "3.1.0-beta",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "module": "src/index.js",
@@ -13,10 +13,10 @@
13
13
  "@emotion/styled": "^11.14.1",
14
14
  "@mui/icons-material": "^7.3.4",
15
15
  "@mui/material": "^7.3.4",
16
- "@pie-lib/drag": "^4.0.6",
17
- "@pie-lib/editable-html-tip-tap": "^2.1.11",
18
- "@pie-lib/math-rendering": "^5.1.0",
19
- "@pie-lib/render-ui": "^6.1.3",
16
+ "@pie-lib/drag": "^4.0.2",
17
+ "@pie-lib/editable-html-tip-tap": "^2.2.0-beta",
18
+ "@pie-lib/math-rendering": "^5.0.2",
19
+ "@pie-lib/render-ui": "^6.1.0",
20
20
  "classnames": "^2.2.6",
21
21
  "debug": "^4.1.1",
22
22
  "lodash-es": "^4.17.23",
@@ -28,5 +28,5 @@
28
28
  "keywords": [],
29
29
  "author": "",
30
30
  "license": "ISC",
31
- "gitHead": "674bec751a99ddb5a3525f08ff48fdc52c68cb02"
31
+ "gitHead": "433bcb776c2975739e7417f133d31cd996164116"
32
32
  }
package/LICENSE.md DELETED
@@ -1,5 +0,0 @@
1
- Copyright 2019 CoreSpring Inc
2
-
3
- Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
4
-
5
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.