@pie-lib/mask-markup 3.1.0-beta.7 → 3.1.0-beta.8

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.
@@ -1 +0,0 @@
1
- {"version":3,"file":"blank.test.js","names":["React","_interopRequireWildcard","require","_react2","_blank","_interopRequireDefault","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","_typeof","has","get","set","_t","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","jest","mock","useDraggable","fn","attributes","listeners","setNodeRef","transform","isDragging","useDroppable","isOver","active","CSS","Translate","toString","renderMath","collectEmotionRules","rules","_i","_Array$from","Array","from","document","styleSheets","length","sheet","_i2","_Array$from2","cssRules","rule","push","cssText","describe","_require","onChange","defaultProps","disabled","choice","value","dragItem","correct","beforeEach","mockClear","it","_render","render","createElement","container","expect","firstChild","toBeInTheDocument","screen","getByText","_extends2","queryByRole","name","not","_render2","_render3","undefined","deleteButton","_render4","emptyResponseAreaHeight","emptyResponseAreaWidth","element","_render5","_render6","useFakeTimers","rectSpy","spyOn","HTMLElement","prototype","mockReturnValue","width","height","top","left","right","bottom","_render7","act","runAllTimers","wrapper","chip","style","toBe","mockRestore","useRealTimers","toHaveBeenCalled","_render8","rerender","callsAfterMount","calls","toBeGreaterThan","_render9","find","includes","toBeDefined","toMatch","test","_render0"],"sources":["../../../src/components/__tests__/blank.test.js"],"sourcesContent":["import * as React from 'react';\nimport { render, screen, act } from '@testing-library/react';\nimport Blank from '../blank';\n\n// Mock @dnd-kit hooks to avoid DndContext requirement\njest.mock('@dnd-kit/core', () => ({\n useDraggable: jest.fn(() => ({\n attributes: {},\n listeners: {},\n setNodeRef: jest.fn(),\n transform: null,\n isDragging: false,\n })),\n useDroppable: jest.fn(() => ({\n setNodeRef: jest.fn(),\n isOver: false,\n active: null,\n })),\n}));\n\njest.mock('@dnd-kit/utilities', () => ({\n CSS: {\n Translate: {\n toString: jest.fn(() => 'translate3d(0, 0, 0)'),\n },\n },\n}));\n\njest.mock('@pie-lib/math-rendering', () => ({\n renderMath: jest.fn(),\n}));\n\n// Collect the CSS rules emotion/MUI injected into the document (jsdom uses insertRule).\nconst collectEmotionRules = () => {\n const rules = [];\n for (const sheet of Array.from(document.styleSheets)) {\n try {\n for (const rule of Array.from(sheet.cssRules)) {\n rules.push(rule.cssText);\n }\n } catch (e) {\n /* inaccessible stylesheet */\n }\n }\n return rules;\n};\n\ndescribe('Blank', () => {\n const { renderMath } = require('@pie-lib/math-rendering');\n const onChange = jest.fn();\n const defaultProps = {\n disabled: false,\n choice: { value: 'Cow' },\n isOver: false,\n dragItem: {},\n correct: false,\n onChange,\n };\n\n beforeEach(() => {\n onChange.mockClear();\n renderMath.mockClear();\n });\n\n describe('rendering', () => {\n it('renders with default props', () => {\n const { container } = render(<Blank {...defaultProps} />);\n expect(container.firstChild).toBeInTheDocument();\n });\n\n it('displays the value when provided', () => {\n render(<Blank {...defaultProps} />);\n expect(screen.getByText('Cow')).toBeInTheDocument();\n });\n\n it('renders as disabled when disabled prop is true', () => {\n render(<Blank {...defaultProps} disabled={true} />);\n // Check that delete button is not present when disabled\n expect(screen.queryByRole('button', { name: /delete/i })).not.toBeInTheDocument();\n });\n\n it('renders with dragged item preview', () => {\n render(<Blank {...defaultProps} dragItem={{ choice: { value: 'Dog' } }} />);\n // Blank component should render\n expect(screen.getByText('Cow')).toBeInTheDocument();\n });\n\n it('shows hover state when isOver is true', () => {\n const { container } = render(<Blank {...defaultProps} dragItem={{ choice: { value: 'Dog' } }} isOver={true} />);\n // Component should have hover styling\n expect(container.firstChild).toBeInTheDocument();\n });\n\n it('shows correct state when correct is true', () => {\n const { container } = render(<Blank {...defaultProps} correct={true} />);\n // Component should indicate correctness\n expect(container.firstChild).toBeInTheDocument();\n });\n });\n\n describe('delete functionality', () => {\n it('does not show delete button when disabled', () => {\n render(<Blank {...defaultProps} disabled={true} />);\n expect(screen.queryByRole('button', { name: /delete/i })).not.toBeInTheDocument();\n });\n\n it('does not show delete button when no value is set', () => {\n render(<Blank {...defaultProps} choice={undefined} />);\n expect(screen.queryByRole('button', { name: /delete/i })).not.toBeInTheDocument();\n });\n\n it('shows delete button when value is present and not disabled', () => {\n render(<Blank {...defaultProps} />);\n // If delete button is present, it should be clickable\n const deleteButton = screen.queryByRole('button');\n if (deleteButton) {\n expect(deleteButton).toBeInTheDocument();\n }\n });\n });\n\n describe('dimensions', () => {\n it('renders with custom dimensions when provided', () => {\n const { container } = render(\n <Blank {...defaultProps} emptyResponseAreaHeight={100} emptyResponseAreaWidth={200} />,\n );\n const element = container.firstChild;\n expect(element).toBeInTheDocument();\n });\n\n it('renders with min dimensions by default', () => {\n const { container } = render(<Blank {...defaultProps} />);\n const element = container.firstChild;\n expect(element).toBeInTheDocument();\n // Component should have minimum dimensions applied\n });\n\n it('handles non-numeric dimension props gracefully', () => {\n const { container } = render(\n <Blank {...defaultProps} emptyResponseAreaHeight=\"non-numeric\" emptyResponseAreaWidth=\"non-numeric\" />,\n );\n expect(container.firstChild).toBeInTheDocument();\n });\n\n it('computes chip dimensions based on content when no emptyResponseArea size is provided', () => {\n jest.useFakeTimers();\n // Mock getBoundingClientRect to simulate measured content size\n const rectSpy = jest\n .spyOn(HTMLElement.prototype, 'getBoundingClientRect')\n .mockReturnValue({ width: 100, height: 20, top: 0, left: 0, right: 100, bottom: 20 });\n\n const { container } = render(\n <Blank\n {...defaultProps}\n // Force measurement path that uses getMeasureNode / updateDimensions\n emptyResponseAreaHeight={0}\n emptyResponseAreaWidth={0}\n />,\n );\n\n // Let the internal timeout in handleElements / updateDimensions run\n act(() => {\n jest.runAllTimers();\n });\n\n const wrapper = container.firstChild; // StyledContent\n const chip = wrapper && wrapper.firstChild; // StyledChip (rootRef)\n\n // Width and height should include padding (24px) around measured content\n expect(chip.style.width).toBe('129px');\n expect(chip.style.height).toBe('49px');\n\n rectSpy.mockRestore();\n jest.useRealTimers();\n });\n });\n\n describe('math rendering', () => {\n it('calls renderMath on mount when choice has content', () => {\n render(<Blank {...defaultProps} />);\n expect(renderMath).toHaveBeenCalled();\n });\n\n it('calls renderMath again when correct changes', () => {\n const { rerender } = render(<Blank {...defaultProps} correct={false} />);\n const callsAfterMount = renderMath.mock.calls.length;\n expect(callsAfterMount).toBeGreaterThan(0);\n\n rerender(<Blank {...defaultProps} correct={true} />);\n expect(renderMath.mock.calls.length).toBeGreaterThan(callsAfterMount);\n });\n\n it('does not call renderMath again when correct is unchanged', () => {\n const { rerender } = render(<Blank {...defaultProps} correct={true} />);\n const callsAfterMount = renderMath.mock.calls.length;\n\n rerender(<Blank {...defaultProps} correct={true} />);\n expect(renderMath.mock.calls.length).toBe(callsAfterMount);\n });\n });\n\n describe('fraction math styling', () => {\n it('enlarges numerator/denominator digits adjacent to a fraction to 120%', () => {\n render(<Blank {...defaultProps} />);\n const rule = collectEmotionRules().find((r) => r.includes('mjx-mn') && r.includes('mjx-mfrac'));\n expect(rule).toBeDefined();\n expect(rule).toMatch(/mjx-mn:has\\(~\\s*mjx-mfrac\\)/);\n expect(rule).toMatch(/mjx-mfrac\\s*~\\s*mjx-mn/);\n expect(rule).toMatch(/font-size:\\s*120%\\s*!important/i);\n });\n\n it('keeps the existing mjx-frac 120% rule', () => {\n render(<Blank {...defaultProps} />);\n const rule = collectEmotionRules().find((r) => /(^|[^-])mjx-frac/.test(r) && !r.includes('mjx-mfrac'));\n expect(rule).toBeDefined();\n expect(rule).toMatch(/font-size:\\s*120%\\s*!important/i);\n });\n });\n\n describe('drag and drop', () => {\n it('accepts drag item when not disabled', () => {\n render(<Blank {...defaultProps} isOver={true} dragItem={{ choice: { value: 'Dog' } }} />);\n expect(screen.getByText('Cow')).toBeInTheDocument();\n });\n\n it('shows drag preview when dragging over', () => {\n const { container } = render(<Blank {...defaultProps} isOver={true} dragItem={{ choice: { value: 'Dog' } }} />);\n expect(container.firstChild).toBeInTheDocument();\n // Should show visual feedback for drag over\n });\n });\n});\n"],"mappings":";;;;;AAAA,IAAAA,KAAA,GAAAC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E,CAAC,qCAAqC,EAAE,YAAM;MAC9C,IAAAE,cAAM,eAACvE,KAAA,CAAAwE,aAAA,CAACpE,MAAA,WAAK,MAAA2E,SAAA,iBAAKlB,YAAY;QAAEzB,MAAM,EAAE,IAAK;QAAC6B,QAAQ,EAAE;UAAEF,MAAM,EAAE;YAAEC,KAAK,EAAE;UAAM;QAAE;MAAE,EAAE,CAAC,CAAC;MACzFU,MAAM,CAACG,cAAM,CAACC,SAAS,CAAC,KAAK,CAAC,CAAC,CAACF,iBAAiB,CAAC,CAAC;IACrD,CAAC,CAAC;IAEFP,EAAE,CAAC,uCAAuC,EAAE,YAAM;MAChD,IAAAyD,QAAA,GAAsB,IAAAvD,cAAM,eAACvE,KAAA,CAAAwE,aAAA,CAACpE,MAAA,WAAK,MAAA2E,SAAA,iBAAKlB,YAAY;UAAEzB,MAAM,EAAE,IAAK;UAAC6B,QAAQ,EAAE;YAAEF,MAAM,EAAE;cAAEC,KAAK,EAAE;YAAM;UAAE;QAAE,EAAE,CAAC,CAAC;QAAvGS,SAAS,GAAAqD,QAAA,CAATrD,SAAS;MACjBC,MAAM,CAACD,SAAS,CAACE,UAAU,CAAC,CAACC,iBAAiB,CAAC,CAAC;MAChD;IACF,CAAC,CAAC;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
@@ -1,132 +0,0 @@
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 _correctInput = _interopRequireDefault(require("../correct-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
- describe('CorrectInput', function () {
14
- var onChange = jest.fn();
15
- var defaultProps = {
16
- disabled: false,
17
- correct: false,
18
- variant: 'outlined',
19
- value: 'Cow',
20
- onChange: onChange
21
- };
22
- beforeEach(function () {
23
- onChange.mockClear();
24
- });
25
- describe('rendering', function () {
26
- it('renders input with default props', function () {
27
- (0, _react2.render)(/*#__PURE__*/React.createElement(_correctInput["default"], defaultProps));
28
- var input = _react2.screen.getByRole('textbox');
29
- expect(input).toBeInTheDocument();
30
- expect(input).toHaveValue('Cow');
31
- });
32
- it('renders as disabled when disabled prop is true', function () {
33
- (0, _react2.render)(/*#__PURE__*/React.createElement(_correctInput["default"], (0, _extends2["default"])({}, defaultProps, {
34
- disabled: true
35
- })));
36
- var input = _react2.screen.getByRole('textbox');
37
- expect(input).toBeDisabled();
38
- });
39
- it('renders with correct state as false', function () {
40
- var _render = (0, _react2.render)(/*#__PURE__*/React.createElement(_correctInput["default"], (0, _extends2["default"])({}, defaultProps, {
41
- correct: false
42
- }))),
43
- container = _render.container;
44
- var input = _react2.screen.getByRole('textbox');
45
- expect(input).toBeInTheDocument();
46
- });
47
- it('renders with correct state as true', function () {
48
- var _render2 = (0, _react2.render)(/*#__PURE__*/React.createElement(_correctInput["default"], (0, _extends2["default"])({}, defaultProps, {
49
- correct: true
50
- }))),
51
- container = _render2.container;
52
- var input = _react2.screen.getByRole('textbox');
53
- expect(input).toBeInTheDocument();
54
- // Should show visual indication of correctness
55
- });
56
- it('renders with outlined variant', function () {
57
- (0, _react2.render)(/*#__PURE__*/React.createElement(_correctInput["default"], (0, _extends2["default"])({}, defaultProps, {
58
- variant: "outlined"
59
- })));
60
- var input = _react2.screen.getByRole('textbox');
61
- expect(input).toBeInTheDocument();
62
- });
63
- });
64
- describe('user interactions', function () {
65
- it('calls onChange when user types', /*#__PURE__*/(0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee() {
66
- var user, input;
67
- return _regenerator["default"].wrap(function (_context) {
68
- while (1) switch (_context.prev = _context.next) {
69
- case 0:
70
- user = _userEvent["default"].setup();
71
- (0, _react2.render)(/*#__PURE__*/React.createElement(_correctInput["default"], defaultProps));
72
- input = _react2.screen.getByRole('textbox');
73
- _context.next = 1;
74
- return user.clear(input);
75
- case 1:
76
- _context.next = 2;
77
- return user.type(input, '1');
78
- case 2:
79
- expect(onChange).toHaveBeenCalled();
80
- case 3:
81
- case "end":
82
- return _context.stop();
83
- }
84
- }, _callee);
85
- })));
86
- it('calls onChange with event object', /*#__PURE__*/(0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee2() {
87
- var user, input, lastCall;
88
- return _regenerator["default"].wrap(function (_context2) {
89
- while (1) switch (_context2.prev = _context2.next) {
90
- case 0:
91
- user = _userEvent["default"].setup();
92
- (0, _react2.render)(/*#__PURE__*/React.createElement(_correctInput["default"], (0, _extends2["default"])({}, defaultProps, {
93
- value: ""
94
- })));
95
- input = _react2.screen.getByRole('textbox');
96
- _context2.next = 1;
97
- return user.type(input, 'test');
98
- case 1:
99
- expect(onChange).toHaveBeenCalled();
100
- // Check that onChange receives an event-like object
101
- lastCall = onChange.mock.calls[onChange.mock.calls.length - 1][0];
102
- expect(lastCall).toHaveProperty('target');
103
- case 2:
104
- case "end":
105
- return _context2.stop();
106
- }
107
- }, _callee2);
108
- })));
109
- it('updates value when user changes input', /*#__PURE__*/(0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee3() {
110
- var user, input;
111
- return _regenerator["default"].wrap(function (_context3) {
112
- while (1) switch (_context3.prev = _context3.next) {
113
- case 0:
114
- user = _userEvent["default"].setup();
115
- (0, _react2.render)(/*#__PURE__*/React.createElement(_correctInput["default"], defaultProps));
116
- input = _react2.screen.getByRole('textbox');
117
- _context3.next = 1;
118
- return user.clear(input);
119
- case 1:
120
- _context3.next = 2;
121
- return user.type(input, 'Dog');
122
- case 2:
123
- expect(onChange).toHaveBeenCalled();
124
- case 3:
125
- case "end":
126
- return _context3.stop();
127
- }
128
- }, _callee3);
129
- })));
130
- });
131
- });
132
- //# sourceMappingURL=correct-input.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"correct-input.test.js","names":["React","_interopRequireWildcard","require","_react2","_userEvent","_interopRequireDefault","_correctInput","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","disabled","correct","variant","value","beforeEach","mockClear","it","render","createElement","input","screen","getByRole","expect","toBeInTheDocument","toHaveValue","_extends2","toBeDisabled","_render","container","_render2","_asyncToGenerator2","_regenerator","mark","_callee","user","wrap","_context","prev","next","userEvent","setup","clear","type","toHaveBeenCalled","stop","_callee2","lastCall","_context2","mock","calls","length","toHaveProperty","_callee3","_context3"],"sources":["../../../src/components/__tests__/correct-input.test.js"],"sourcesContent":["import * as React from 'react';\nimport { render, screen } from '@testing-library/react';\nimport userEvent from '@testing-library/user-event';\nimport CorrectInput from '../correct-input';\n\ndescribe('CorrectInput', () => {\n const onChange = jest.fn();\n const defaultProps = {\n disabled: false,\n correct: false,\n variant: 'outlined',\n value: 'Cow',\n onChange,\n };\n\n beforeEach(() => {\n onChange.mockClear();\n });\n\n describe('rendering', () => {\n it('renders input with default props', () => {\n render(<CorrectInput {...defaultProps} />);\n const input = screen.getByRole('textbox');\n expect(input).toBeInTheDocument();\n expect(input).toHaveValue('Cow');\n });\n\n it('renders as disabled when disabled prop is true', () => {\n render(<CorrectInput {...defaultProps} disabled={true} />);\n const input = screen.getByRole('textbox');\n expect(input).toBeDisabled();\n });\n\n it('renders with correct state as false', () => {\n const { container } = render(<CorrectInput {...defaultProps} correct={false} />);\n const input = screen.getByRole('textbox');\n expect(input).toBeInTheDocument();\n });\n\n it('renders with correct state as true', () => {\n const { container } = render(<CorrectInput {...defaultProps} correct={true} />);\n const input = screen.getByRole('textbox');\n expect(input).toBeInTheDocument();\n // Should show visual indication of correctness\n });\n\n it('renders with outlined variant', () => {\n render(<CorrectInput {...defaultProps} variant=\"outlined\" />);\n const input = screen.getByRole('textbox');\n expect(input).toBeInTheDocument();\n });\n });\n\n describe('user interactions', () => {\n it('calls onChange when user types', async () => {\n const user = userEvent.setup();\n render(<CorrectInput {...defaultProps} />);\n\n const input = screen.getByRole('textbox');\n await user.clear(input);\n await user.type(input, '1');\n\n expect(onChange).toHaveBeenCalled();\n });\n\n it('calls onChange with event object', async () => {\n const user = userEvent.setup();\n render(<CorrectInput {...defaultProps} value=\"\" />);\n\n const input = screen.getByRole('textbox');\n await user.type(input, 'test');\n\n expect(onChange).toHaveBeenCalled();\n // Check that onChange receives an event-like object\n const lastCall = onChange.mock.calls[onChange.mock.calls.length - 1][0];\n expect(lastCall).toHaveProperty('target');\n });\n\n it('updates value when user changes input', async () => {\n const user = userEvent.setup();\n render(<CorrectInput {...defaultProps} />);\n\n const input = screen.getByRole('textbox');\n await user.clear(input);\n await user.type(input, 'Dog');\n\n expect(onChange).toHaveBeenCalled();\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,aAAA,GAAAD,sBAAA,CAAAH,OAAA;AAA4C,SAAAD,wBAAAM,CAAA,EAAAC,CAAA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A;MAAA,IAAAlB,IAAA,EAAAf,KAAA;MAAA,OAAAY,YAAA,YAAAI,IAAA,WAAAkB,SAAA;QAAA,kBAAAA,SAAA,CAAAhB,IAAA,GAAAgB,SAAA,CAAAf,IAAA;UAAA;YACpCJ,IAAI,GAAGK,qBAAS,CAACC,KAAK,CAAC,CAAC;YAC9B,IAAAvB,cAAM,eAACvC,KAAA,CAAAwC,aAAA,CAAClC,aAAA,WAAY,EAAKyB,YAAe,CAAC,CAAC;YAEpCU,KAAK,GAAGC,cAAM,CAACC,SAAS,CAAC,SAAS,CAAC;YAAAgC,SAAA,CAAAf,IAAA;YAAA,OACnCJ,IAAI,CAACO,KAAK,CAACtB,KAAK,CAAC;UAAA;YAAAkC,SAAA,CAAAf,IAAA;YAAA,OACjBJ,IAAI,CAACQ,IAAI,CAACvB,KAAK,EAAE,KAAK,CAAC;UAAA;YAE7BG,MAAM,CAAChB,QAAQ,CAAC,CAACqC,gBAAgB,CAAC,CAAC;UAAC;UAAA;YAAA,OAAAU,SAAA,CAAAT,IAAA;QAAA;MAAA,GAAAQ,QAAA;IAAA,CACrC,GAAC;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
@@ -1,202 +0,0 @@
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
@@ -1 +0,0 @@
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,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AS,CAACC,KAAK,CAAC,CAAC;YAC9B,IAAAnB,cAAM,eAAC1C,KAAA,CAAA2C,aAAA,CAACpC,SAAA,WAAQ,EAAKyB,YAAe,CAAC,CAAC;;YAEtC;YACMY,MAAM,GAAGC,cAAM,CAACC,SAAS,CAAC,UAAU,CAAC;YAAA+C,SAAA,CAAAlC,IAAA;YAAA,OACrCL,IAAI,CAACQ,KAAK,CAAClB,MAAM,CAAC;UAAA;YAExB;YACMW,OAAO,GAAGV,cAAM,CAACkB,YAAY,CAAC,QAAQ,CAAC;YACvC6B,YAAY,GAAGrC,OAAO,CAAC+B,IAAI,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":[]}
@@ -1,129 +0,0 @@
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
@@ -1 +0,0 @@
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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