@handlewithcare/react-prosemirror 2.8.0-tiptap.10 → 2.8.0-tiptap.11

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.
Files changed (60) hide show
  1. package/dist/cjs/tiptap/tiptapNodeView.js +26 -13
  2. package/dist/esm/tiptap/tiptapNodeView.js +27 -14
  3. package/dist/tsconfig.tsbuildinfo +1 -1
  4. package/dist/types/constants.d.ts +1 -1
  5. package/dist/types/props.d.ts +26 -26
  6. package/package.json +1 -1
  7. package/dist/esm/@jest/pattern/src/__tests__/TestPathPatterns.test.js +0 -241
  8. package/dist/esm/@swc/cli/lib/swc/__tests__/compile.test.js +0 -19
  9. package/dist/esm/@swc/cli/lib/swc/__tests__/options.test.js +0 -315
  10. package/dist/esm/@swc/cli/lib/swc/__tests__/sources.test.js +0 -161
  11. package/dist/esm/@uiw/react-codemirror/src/__tests__/index.test.js +0 -111
  12. package/dist/esm/cheerio/src/__tests__/deprecated.spec.js +0 -249
  13. package/dist/esm/cheerio/src/__tests__/xml.spec.js +0 -55
  14. package/dist/esm/components/__tests__/ProseMirror.composition.test.js +0 -395
  15. package/dist/esm/components/__tests__/ProseMirror.domchange.test.js +0 -266
  16. package/dist/esm/components/__tests__/ProseMirror.draw-decoration.test.js +0 -968
  17. package/dist/esm/components/__tests__/ProseMirror.draw.test.js +0 -335
  18. package/dist/esm/components/__tests__/ProseMirror.mobile.test.js +0 -54
  19. package/dist/esm/components/__tests__/ProseMirror.node-view.test.js +0 -553
  20. package/dist/esm/components/__tests__/ProseMirror.selection.test.js +0 -440
  21. package/dist/esm/components/__tests__/ProseMirror.test.js +0 -324
  22. package/dist/esm/contexts/__tests__/DeferredLayoutEffects.test.js +0 -98
  23. package/dist/esm/hooks/__tests__/useEditorEffect.test.js +0 -134
  24. package/dist/esm/jsx-ast-utils/__tests__/helper.js +0 -83
  25. package/dist/esm/jsx-ast-utils/__tests__/src/elementType-test.js +0 -76
  26. package/dist/esm/jsx-ast-utils/__tests__/src/eventHandlers-test.js +0 -98
  27. package/dist/esm/jsx-ast-utils/__tests__/src/getProp-parser-test.js +0 -188
  28. package/dist/esm/jsx-ast-utils/__tests__/src/getProp-test.js +0 -119
  29. package/dist/esm/jsx-ast-utils/__tests__/src/getPropLiteralValue-babelparser-test.js +0 -393
  30. package/dist/esm/jsx-ast-utils/__tests__/src/getPropLiteralValue-flowparser-test.js +0 -379
  31. package/dist/esm/jsx-ast-utils/__tests__/src/getPropValue-babelparser-test.js +0 -925
  32. package/dist/esm/jsx-ast-utils/__tests__/src/getPropValue-flowparser-test.js +0 -700
  33. package/dist/esm/jsx-ast-utils/__tests__/src/hasProp-test.js +0 -350
  34. package/dist/esm/jsx-ast-utils/__tests__/src/index-test.js +0 -24
  35. package/dist/esm/jsx-ast-utils/__tests__/src/propName-test.js +0 -37
  36. package/dist/esm/plugins/__tests__/reactKeys.test.js +0 -77
  37. package/dist/esm/tsconfig-paths/lib/__tests__/config-loader.test.d.js +0 -1
  38. package/dist/esm/tsconfig-paths/lib/__tests__/config-loader.test.js +0 -97
  39. package/dist/esm/tsconfig-paths/lib/__tests__/data/match-path-data.d.js +0 -1
  40. package/dist/esm/tsconfig-paths/lib/__tests__/data/match-path-data.js +0 -319
  41. package/dist/esm/tsconfig-paths/lib/__tests__/filesystem.test.d.js +0 -1
  42. package/dist/esm/tsconfig-paths/lib/__tests__/filesystem.test.js +0 -62
  43. package/dist/esm/tsconfig-paths/lib/__tests__/mapping-entry.test.d.js +0 -1
  44. package/dist/esm/tsconfig-paths/lib/__tests__/mapping-entry.test.js +0 -80
  45. package/dist/esm/tsconfig-paths/lib/__tests__/match-path-async.test.d.js +0 -1
  46. package/dist/esm/tsconfig-paths/lib/__tests__/match-path-async.test.js +0 -22
  47. package/dist/esm/tsconfig-paths/lib/__tests__/match-path-sync.test.d.js +0 -1
  48. package/dist/esm/tsconfig-paths/lib/__tests__/match-path-sync.test.js +0 -20
  49. package/dist/esm/tsconfig-paths/lib/__tests__/try-path.test.d.js +0 -1
  50. package/dist/esm/tsconfig-paths/lib/__tests__/try-path.test.js +0 -219
  51. package/dist/esm/tsconfig-paths/lib/__tests__/tsconfig-loader.test.d.js +0 -1
  52. package/dist/esm/tsconfig-paths/lib/__tests__/tsconfig-loader.test.js +0 -323
  53. package/dist/esm/tsconfig-paths/src/__tests__/config-loader.test.js +0 -89
  54. package/dist/esm/tsconfig-paths/src/__tests__/data/match-path-data.js +0 -314
  55. package/dist/esm/tsconfig-paths/src/__tests__/filesystem.test.js +0 -58
  56. package/dist/esm/tsconfig-paths/src/__tests__/mapping-entry.test.js +0 -76
  57. package/dist/esm/tsconfig-paths/src/__tests__/match-path-async.test.js +0 -12
  58. package/dist/esm/tsconfig-paths/src/__tests__/match-path-sync.test.js +0 -10
  59. package/dist/esm/tsconfig-paths/src/__tests__/try-path.test.js +0 -214
  60. package/dist/esm/tsconfig-paths/src/__tests__/tsconfig-loader.test.js +0 -296
@@ -1,315 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- const _deepmerge = /*#__PURE__*/ _interopRequireDefault(require("deepmerge"));
6
- const _options = /*#__PURE__*/ _interopRequireWildcard(require("../options"));
7
- function _interopRequireDefault(obj) {
8
- return obj && obj.__esModule ? obj : {
9
- default: obj
10
- };
11
- }
12
- function _getRequireWildcardCache(nodeInterop) {
13
- if (typeof WeakMap !== "function") return null;
14
- var cacheBabelInterop = new WeakMap();
15
- var cacheNodeInterop = new WeakMap();
16
- return (_getRequireWildcardCache = function(nodeInterop) {
17
- return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
18
- })(nodeInterop);
19
- }
20
- function _interopRequireWildcard(obj, nodeInterop) {
21
- if (!nodeInterop && obj && obj.__esModule) {
22
- return obj;
23
- }
24
- if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
25
- return {
26
- default: obj
27
- };
28
- }
29
- var cache = _getRequireWildcardCache(nodeInterop);
30
- if (cache && cache.has(obj)) {
31
- return cache.get(obj);
32
- }
33
- var newObj = {};
34
- var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
35
- for(var key in obj){
36
- if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
37
- var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
38
- if (desc && (desc.get || desc.set)) {
39
- Object.defineProperty(newObj, key, desc);
40
- } else {
41
- newObj[key] = obj[key];
42
- }
43
- }
44
- }
45
- newObj.default = obj;
46
- if (cache) {
47
- cache.set(obj, newObj);
48
- }
49
- return newObj;
50
- }
51
- const createDefaultResult = ()=>({
52
- cliOptions: {
53
- copyFiles: false,
54
- deleteDirOnStart: false,
55
- extensions: [
56
- ".js",
57
- ".jsx",
58
- ".es6",
59
- ".es",
60
- ".mjs",
61
- ".ts",
62
- ".tsx",
63
- ".cts",
64
- ".mts"
65
- ],
66
- // @ts-expect-error
67
- filename: undefined,
68
- filenames: [
69
- "src"
70
- ],
71
- ignore: [],
72
- includeDotfiles: false,
73
- only: [],
74
- // @ts-expect-error
75
- outDir: undefined,
76
- // @ts-expect-error
77
- outFile: undefined,
78
- quiet: false,
79
- sourceMapTarget: undefined,
80
- sync: false,
81
- watch: false
82
- },
83
- swcOptions: {
84
- configFile: undefined,
85
- jsc: {
86
- parser: undefined,
87
- transform: {}
88
- },
89
- sourceFileName: undefined,
90
- sourceMaps: undefined,
91
- sourceRoot: undefined,
92
- swcrc: true
93
- }
94
- });
95
- describe("parserArgs", ()=>{
96
- let defaultResult;
97
- beforeEach(()=>{
98
- defaultResult = createDefaultResult();
99
- (0, _options.initProgram)();
100
- });
101
- it("minimal args returns default result", async ()=>{
102
- const args = [
103
- "node",
104
- "/path/to/node_modules/swc-cli/bin/swc.js",
105
- "src"
106
- ];
107
- const result = await (0, _options.default)(args);
108
- expect(result).toEqual(defaultResult);
109
- });
110
- describe("errors", ()=>{
111
- let mockExit;
112
- let mockConsoleError;
113
- beforeAll(()=>{
114
- //@ts-expect-error
115
- mockExit = jest.spyOn(process, "exit").mockImplementation(()=>{});
116
- mockConsoleError = jest.spyOn(console, "error").mockImplementation(()=>{});
117
- });
118
- beforeEach(()=>{
119
- mockExit.mockClear();
120
- mockConsoleError.mockClear();
121
- });
122
- afterAll(()=>{
123
- mockExit.mockRestore();
124
- mockConsoleError.mockRestore();
125
- });
126
- it("exits without filenames", async ()=>{
127
- const args = [
128
- "node",
129
- "/path/to/node_modules/swc-cli/bin/swc.js"
130
- ];
131
- await (0, _options.default)(args);
132
- expect(mockExit).toHaveBeenCalledWith(2);
133
- expect(mockConsoleError).toHaveBeenCalledTimes(2);
134
- });
135
- it("--watch exits without --out-dir", async ()=>{
136
- const args = [
137
- "node",
138
- "/path/to/node_modules/swc-cli/bin/swc.js",
139
- "src",
140
- "--watch"
141
- ];
142
- await (0, _options.default)(args);
143
- expect(mockExit).toHaveBeenCalledWith(2);
144
- expect(mockConsoleError).toHaveBeenCalledTimes(2);
145
- });
146
- it("--watch exits without filenames", async ()=>{
147
- const args = [
148
- "node",
149
- "/path/to/node_modules/swc-cli/bin/swc.js",
150
- "--watch",
151
- "--out-dir",
152
- "esm"
153
- ];
154
- await (0, _options.default)(args);
155
- expect(mockExit).toHaveBeenCalledWith(2);
156
- expect(mockConsoleError).toHaveBeenCalledTimes(3);
157
- });
158
- it("--out-dir exits with conflicting -out-file", async ()=>{
159
- const args = [
160
- "node",
161
- "/path/to/node_modules/swc-cli/bin/swc.js",
162
- "src",
163
- "--out-file",
164
- "esm/index.js",
165
- "--out-dir",
166
- "esm"
167
- ];
168
- await (0, _options.default)(args);
169
- expect(mockExit).toHaveBeenCalledWith(2);
170
- expect(mockConsoleError).toHaveBeenCalledTimes(2);
171
- });
172
- });
173
- describe("--source-maps", ()=>{
174
- it("source maps is ambiguous", async ()=>{
175
- const args = [
176
- "node",
177
- "/path/to/node_modules/swc-cli/bin/swc.js",
178
- "src",
179
- "--source-maps"
180
- ];
181
- const result = await (0, _options.default)(args);
182
- const expectedOptions = (0, _deepmerge.default)(defaultResult, {
183
- swcOptions: {
184
- sourceMaps: true
185
- }
186
- });
187
- expect(result).toEqual(expectedOptions);
188
- });
189
- it("source maps true", async ()=>{
190
- const args = [
191
- "node",
192
- "/path/to/node_modules/swc-cli/bin/swc.js",
193
- "--source-maps",
194
- "true",
195
- "src"
196
- ];
197
- const result = await (0, _options.default)(args);
198
- const expectedOptions = (0, _deepmerge.default)(defaultResult, {
199
- swcOptions: {
200
- sourceMaps: true
201
- }
202
- });
203
- expect(result).toEqual(expectedOptions);
204
- });
205
- it("source maps inline", async ()=>{
206
- const args = [
207
- "node",
208
- "/path/to/node_modules/swc-cli/bin/swc.js",
209
- "-s",
210
- "inline",
211
- "src"
212
- ];
213
- const result = await (0, _options.default)(args);
214
- const expectedOptions = (0, _deepmerge.default)(defaultResult, {
215
- swcOptions: {
216
- sourceMaps: "inline"
217
- }
218
- });
219
- expect(result).toEqual(expectedOptions);
220
- });
221
- });
222
- describe("--config", ()=>{
223
- it("throws with no config", async ()=>{
224
- const args = [
225
- "node",
226
- "/path/to/node_modules/swc-cli/bin/swc.js",
227
- "src",
228
- "-C"
229
- ];
230
- expect(()=>(0, _options.default)(args)).toThrow();
231
- });
232
- it("react development", async ()=>{
233
- const args = [
234
- "node",
235
- "/path/to/node_modules/swc-cli/bin/swc.js",
236
- "--config",
237
- "jsc.transform.react.development=true",
238
- "src"
239
- ];
240
- const result = await (0, _options.default)(args);
241
- const expectedOptions = (0, _deepmerge.default)(defaultResult.swcOptions, {
242
- jsc: {
243
- transform: {
244
- react: {
245
- development: true
246
- }
247
- }
248
- }
249
- });
250
- expect(result.swcOptions).toEqual(expectedOptions);
251
- });
252
- it("react development and commonjs (two config options)", async ()=>{
253
- const args = [
254
- "node",
255
- "/path/to/node_modules/swc-cli/bin/swc.js",
256
- "--config",
257
- "jsc.transform.react.development=true",
258
- "-C",
259
- "module.type=commonjs",
260
- "src"
261
- ];
262
- const result = await (0, _options.default)(args);
263
- const expectedOptions = (0, _deepmerge.default)(defaultResult.swcOptions, {
264
- jsc: {
265
- transform: {
266
- react: {
267
- development: true
268
- }
269
- }
270
- },
271
- module: {
272
- type: "commonjs"
273
- }
274
- });
275
- expect(result.swcOptions).toEqual(expectedOptions);
276
- });
277
- it("react development and commonjs (comma-separated)", async ()=>{
278
- const args = [
279
- "node",
280
- "/path/to/node_modules/swc-cli/bin/swc.js",
281
- "--config",
282
- "jsc.transform.react.development=true,module.type=commonjs",
283
- "src"
284
- ];
285
- const result = await (0, _options.default)(args);
286
- const expectedOptions = (0, _deepmerge.default)(defaultResult.swcOptions, {
287
- jsc: {
288
- transform: {
289
- react: {
290
- development: true
291
- }
292
- }
293
- },
294
- module: {
295
- type: "commonjs"
296
- }
297
- });
298
- expect(result.swcOptions).toEqual(expectedOptions);
299
- });
300
- it("no equals sign", async ()=>{
301
- const args = [
302
- "node",
303
- "/path/to/node_modules/swc-cli/bin/swc.js",
304
- "--config",
305
- "no_equals",
306
- "src"
307
- ];
308
- const result = await (0, _options.default)(args);
309
- const expectedOptions = (0, _deepmerge.default)(defaultResult.swcOptions, {
310
- no_equals: true
311
- });
312
- expect(result.swcOptions).toEqual(expectedOptions);
313
- });
314
- });
315
- }); //# sourceMappingURL=options.test.js.map
@@ -1,161 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- const _sources = require("../sources");
6
- const _fs = /*#__PURE__*/ _interopRequireDefault(require("fs"));
7
- const _fastGlob = /*#__PURE__*/ _interopRequireDefault(require("fast-glob"));
8
- function _interopRequireDefault(obj) {
9
- return obj && obj.__esModule ? obj : {
10
- default: obj
11
- };
12
- }
13
- jest.mock("fs");
14
- jest.mock("fast-glob");
15
- describe("globSources", ()=>{
16
- beforeEach(()=>{
17
- _fs.default.resetMockStats();
18
- });
19
- it("exclude dotfiles sources when includeDotfiles=false", async ()=>{
20
- const files = await (0, _sources.globSources)([
21
- ".dotfile"
22
- ], [], [], false);
23
- expect([
24
- ...files
25
- ]).toEqual([]);
26
- });
27
- it("include dotfiles sources when includeDotfiles=true", async ()=>{
28
- _fs.default.setMockStats({
29
- ".dotfile": {
30
- isDirectory: ()=>false
31
- }
32
- });
33
- const files = await (0, _sources.globSources)([
34
- ".dotfile"
35
- ], [], [], true);
36
- expect([
37
- ...files
38
- ]).toEqual([
39
- ".dotfile"
40
- ]);
41
- });
42
- it("include multiple file sources", async ()=>{
43
- _fs.default.setMockStats({
44
- ".dotfile": {
45
- isDirectory: ()=>false
46
- }
47
- });
48
- _fs.default.setMockStats({
49
- file: {
50
- isDirectory: ()=>false
51
- }
52
- });
53
- const files = await (0, _sources.globSources)([
54
- ".dotfile",
55
- "file"
56
- ], [], [], true);
57
- expect([
58
- ...files
59
- ]).toEqual([
60
- ".dotfile",
61
- "file"
62
- ]);
63
- });
64
- it("exclude files that errors on stats", async ()=>{
65
- _fs.default.setMockStats({
66
- ".dotfile": {
67
- isDirectory: ()=>false
68
- }
69
- });
70
- _fs.default.setMockStats({
71
- file: new Error("Failed stat")
72
- });
73
- const files = await (0, _sources.globSources)([
74
- ".dotfile",
75
- "file"
76
- ], [], [], true);
77
- expect([
78
- ...files
79
- ]).toEqual([
80
- ".dotfile"
81
- ]);
82
- });
83
- it("includes all files from directory", async ()=>{
84
- _fs.default.setMockStats({
85
- directory: {
86
- isDirectory: ()=>true
87
- }
88
- });
89
- _fs.default.setMockStats({
90
- file: {
91
- isDirectory: ()=>false
92
- }
93
- });
94
- _fastGlob.default.mockResolvedValue([
95
- "fileDir1",
96
- "fileDir2"
97
- ]);
98
- const files = await (0, _sources.globSources)([
99
- "file",
100
- "directory"
101
- ], [], [], true);
102
- expect([
103
- ...files
104
- ]).toEqual([
105
- "file",
106
- "fileDir1",
107
- "fileDir2"
108
- ]);
109
- });
110
- it("exclude files from directory that fail to glob", async ()=>{
111
- _fs.default.setMockStats({
112
- directory: {
113
- isDirectory: ()=>true
114
- }
115
- });
116
- _fs.default.setMockStats({
117
- file: {
118
- isDirectory: ()=>false
119
- }
120
- });
121
- _fastGlob.default.mockRejectedValue(new Error("Failed"));
122
- const files = await (0, _sources.globSources)([
123
- "file",
124
- "directory"
125
- ], [], [], true);
126
- expect([
127
- ...files
128
- ]).toEqual([
129
- "file"
130
- ]);
131
- });
132
- });
133
- describe("splitCompilableAndCopyable", ()=>{
134
- const extensions = [
135
- ".ts"
136
- ];
137
- it("separate compilable and copyable when copyFiles=true", ()=>{
138
- const files = [
139
- "test.ts",
140
- "test.txt"
141
- ];
142
- const [compilable, copyable] = (0, _sources.splitCompilableAndCopyable)(files, extensions, true);
143
- expect(compilable).toEqual([
144
- "test.ts"
145
- ]);
146
- expect(copyable).toEqual([
147
- "test.txt"
148
- ]);
149
- });
150
- it("separate compilable and copyable when copyFiles=false", ()=>{
151
- const files = [
152
- "test.ts",
153
- "test.txt"
154
- ];
155
- const [compilable, copyable] = (0, _sources.splitCompilableAndCopyable)(files, extensions, false);
156
- expect(compilable).toEqual([
157
- "test.ts"
158
- ]);
159
- expect(copyable).toEqual([]);
160
- });
161
- }); //# sourceMappingURL=sources.test.js.map
@@ -1,111 +0,0 @@
1
- /* eslint-disable jest/no-conditional-expect */ import React, { useEffect, useRef } from 'react';
2
- import renderer from 'react-test-renderer';
3
- import { render, fireEvent, screen } from '@testing-library/react';
4
- // import userEvent from '@testing-library/user-event';
5
- // import '@testing-library/jest-dom';
6
- import CodeMirror from '..';
7
- it('CodeMirror', async ()=>{
8
- const component = renderer.create(/*#__PURE__*/ React.createElement(CodeMirror, null));
9
- let tree = component.toJSON();
10
- if (tree && !Array.isArray(tree)) {
11
- expect(tree.type).toEqual('div');
12
- expect(tree.props.className).toEqual('cm-theme-light');
13
- }
14
- });
15
- it('CodeMirror onChange', async ()=>{
16
- const handleChange = jest.fn((value)=>{
17
- expect(value).toEqual('# title');
18
- return Array.isArray(value) ? value.join() : value;
19
- });
20
- render(/*#__PURE__*/ React.createElement(CodeMirror, {
21
- autoFocus: true,
22
- value: "console.log('Hello world!')",
23
- onChange: handleChange
24
- }));
25
- const input = await screen.findByRole('textbox'); // findByRole('textbox');
26
- fireEvent.change(input, {
27
- target: {
28
- textContent: '# title'
29
- }
30
- });
31
- const elm = screen.queryByText('# title');
32
- expect(elm.cmView.dom.innerHTML).toEqual('# title');
33
- });
34
- it('CodeMirror onUpdate', async ()=>{
35
- render(/*#__PURE__*/ React.createElement(CodeMirror, {
36
- value: "console.log('Hello world!')",
37
- autoFocus: true,
38
- onUpdate: (viewUpdate)=>{
39
- expect(viewUpdate.state.doc.length).toEqual(27);
40
- }
41
- }));
42
- });
43
- it('CodeMirror ref', async ()=>{
44
- function Demo() {
45
- const ref = useRef(null);
46
- useEffect(()=>{
47
- expect(Object.keys(ref.current)).toEqual([
48
- 'editor',
49
- 'state',
50
- 'view'
51
- ]);
52
- }, [
53
- ref
54
- ]);
55
- return /*#__PURE__*/ React.createElement(CodeMirror, {
56
- ref: ref,
57
- value: "console.log('Hello world!')"
58
- });
59
- }
60
- render(/*#__PURE__*/ React.createElement(Demo, null));
61
- });
62
- it('CodeMirror theme', async ()=>{
63
- const component = renderer.create(/*#__PURE__*/ React.createElement(CodeMirror, {
64
- theme: "dark"
65
- }));
66
- let tree = component.toJSON();
67
- if (tree && !Array.isArray(tree)) {
68
- expect(tree.type).toEqual('div');
69
- expect(tree.props.className).toEqual('cm-theme-dark');
70
- }
71
- });
72
- it('CodeMirror className', async ()=>{
73
- const component = renderer.create(/*#__PURE__*/ React.createElement(CodeMirror, {
74
- className: "test"
75
- }));
76
- let tree = component.toJSON();
77
- if (tree && !Array.isArray(tree)) {
78
- expect(tree.type).toEqual('div');
79
- expect(tree.props.className).toEqual('cm-theme-light test');
80
- }
81
- });
82
- it('CodeMirror placeholder', async ()=>{
83
- render(/*#__PURE__*/ React.createElement(CodeMirror, {
84
- placeholder: "Hello World",
85
- className: "test"
86
- }));
87
- const elm = screen.queryByText('Hello World');
88
- expect(elm.style['pointerEvents']).toEqual('none');
89
- expect(elm.className).toEqual('cm-placeholder');
90
- });
91
- it('CodeMirror editable', async ()=>{
92
- render(/*#__PURE__*/ React.createElement(CodeMirror, {
93
- editable: false,
94
- className: "test"
95
- }));
96
- const text = screen.getByRole('textbox');
97
- expect(text.className).toEqual('cm-content');
98
- expect(text.tagName).toEqual('DIV');
99
- });
100
- it("CodeMirror doesn't echo changes", async ()=>{
101
- const handleChange = jest.fn();
102
- const { rerender } = render(/*#__PURE__*/ React.createElement(CodeMirror, {
103
- value: "value a",
104
- onChange: handleChange
105
- }));
106
- rerender(/*#__PURE__*/ React.createElement(CodeMirror, {
107
- value: "value b",
108
- onChange: handleChange
109
- }));
110
- expect(handleChange).not.toHaveBeenCalled();
111
- });