@contentful/field-editor-multiple-line 2.0.14-canary.0 → 2.1.1-canary.5

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.
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  const _react = /*#__PURE__*/ _interop_require_wildcard(require("react"));
6
6
  const _fieldeditortestutils = require("@contentful/field-editor-test-utils");
7
7
  const _react1 = require("@testing-library/react");
8
- require("@testing-library/jest-dom/extend-expect");
8
+ const _vitest = require("vitest");
9
9
  const _MultipleLineEditor = require("./MultipleLineEditor");
10
10
  function _getRequireWildcardCache(nodeInterop) {
11
11
  if (typeof WeakMap !== "function") return null;
@@ -51,9 +51,9 @@ function _interop_require_wildcard(obj, nodeInterop) {
51
51
  (0, _react1.configure)({
52
52
  testIdAttribute: 'data-test-id'
53
53
  });
54
- describe('MultipleLineEditor', ()=>{
55
- afterEach(_react1.cleanup);
56
- it('renders without crashing', ()=>{
54
+ (0, _vitest.describe)('MultipleLineEditor', ()=>{
55
+ (0, _vitest.afterEach)(_react1.cleanup);
56
+ (0, _vitest.it)('renders without crashing', ()=>{
57
57
  const [field] = (0, _fieldeditortestutils.createFakeFieldAPI)();
58
58
  (0, _react1.render)(/*#__PURE__*/ _react.createElement(_MultipleLineEditor.MultipleLineEditor, {
59
59
  field: field,
@@ -61,7 +61,7 @@ describe('MultipleLineEditor', ()=>{
61
61
  isInitiallyDisabled: false
62
62
  }));
63
63
  });
64
- it('reads initial value from field.getValue', ()=>{
64
+ (0, _vitest.it)('reads initial value from field.getValue', ()=>{
65
65
  const initialValue = 'initial-value';
66
66
  const [field] = (0, _fieldeditortestutils.createFakeFieldAPI)((field)=>{
67
67
  return {
@@ -77,12 +77,12 @@ describe('MultipleLineEditor', ()=>{
77
77
  locales: (0, _fieldeditortestutils.createFakeLocalesAPI)(),
78
78
  isInitiallyDisabled: false
79
79
  }));
80
- expect(getByTestId('cf-ui-textarea')).toHaveValue(initialValue);
80
+ (0, _vitest.expect)(getByTestId('cf-ui-textarea')).toHaveValue(initialValue);
81
81
  });
82
- it('calls field.setValue when user types and calls field.removeValue when user clears the input', async ()=>{
82
+ (0, _vitest.it)('calls field.setValue when user types and calls field.removeValue when user clears the input', async ()=>{
83
83
  const [field] = (0, _fieldeditortestutils.createFakeFieldAPI)((field)=>{
84
- jest.spyOn(field, 'setValue');
85
- jest.spyOn(field, 'removeValue');
84
+ _vitest.vi.spyOn(field, 'setValue');
85
+ _vitest.vi.spyOn(field, 'removeValue');
86
86
  return {
87
87
  ...field,
88
88
  id: 'field-id'
@@ -94,16 +94,16 @@ describe('MultipleLineEditor', ()=>{
94
94
  isInitiallyDisabled: false
95
95
  }));
96
96
  const $input = getByTestId('cf-ui-textarea');
97
- expect($input).toHaveValue('');
97
+ (0, _vitest.expect)($input).toHaveValue('');
98
98
  _react1.fireEvent.change($input, {
99
99
  target: {
100
100
  value: 'new-value'
101
101
  }
102
102
  });
103
- expect($input).toHaveValue('new-value');
103
+ (0, _vitest.expect)($input).toHaveValue('new-value');
104
104
  await (0, _react1.waitFor)(()=>{
105
- expect(field.setValue).toHaveBeenCalledTimes(1);
106
- expect(field.setValue).toHaveBeenLastCalledWith('new-value');
105
+ (0, _vitest.expect)(field.setValue).toHaveBeenCalledTimes(1);
106
+ (0, _vitest.expect)(field.setValue).toHaveBeenLastCalledWith('new-value');
107
107
  });
108
108
  _react1.fireEvent.change($input, {
109
109
  target: {
@@ -111,9 +111,9 @@ describe('MultipleLineEditor', ()=>{
111
111
  }
112
112
  });
113
113
  await (0, _react1.waitFor)(()=>{
114
- expect($input).toHaveValue('');
115
- expect(field.removeValue).toHaveBeenCalledTimes(1);
116
- expect(field.removeValue).toHaveBeenLastCalledWith();
114
+ (0, _vitest.expect)($input).toHaveValue('');
115
+ (0, _vitest.expect)(field.removeValue).toHaveBeenCalledTimes(1);
116
+ (0, _vitest.expect)(field.removeValue).toHaveBeenLastCalledWith();
117
117
  });
118
118
  });
119
119
  });
@@ -1,7 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import { createFakeFieldAPI, createFakeLocalesAPI } from '@contentful/field-editor-test-utils';
3
3
  import { cleanup, configure, fireEvent, render, waitFor } from '@testing-library/react';
4
- import '@testing-library/jest-dom/extend-expect';
4
+ import { afterEach, describe, expect, it, vi } from 'vitest';
5
5
  import { MultipleLineEditor } from './MultipleLineEditor';
6
6
  configure({
7
7
  testIdAttribute: 'data-test-id'
@@ -36,8 +36,8 @@ describe('MultipleLineEditor', ()=>{
36
36
  });
37
37
  it('calls field.setValue when user types and calls field.removeValue when user clears the input', async ()=>{
38
38
  const [field] = createFakeFieldAPI((field)=>{
39
- jest.spyOn(field, 'setValue');
40
- jest.spyOn(field, 'removeValue');
39
+ vi.spyOn(field, 'setValue');
40
+ vi.spyOn(field, 'removeValue');
41
41
  return {
42
42
  ...field,
43
43
  id: 'field-id'
@@ -1 +1 @@
1
- import '@testing-library/jest-dom/extend-expect';
1
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contentful/field-editor-multiple-line",
3
- "version": "2.0.14-canary.0+72ee3709",
3
+ "version": "2.1.1-canary.5+3e29f973",
4
4
  "main": "dist/cjs/index.js",
5
5
  "module": "dist/esm/index.js",
6
6
  "types": "dist/types/index.d.ts",
@@ -31,18 +31,18 @@
31
31
  "build:types": "tsc --outDir dist/types --emitDeclarationOnly",
32
32
  "build:cjs": "swc src --config-file ../../.swcrc -d dist/cjs -C module.type=commonjs",
33
33
  "build:esm": "swc src --config-file ../../.swcrc -d dist/esm",
34
- "test": "jest --watch",
35
- "test:ci": "jest --ci",
34
+ "test": "vitest",
35
+ "test:ci": "vitest run",
36
36
  "tsc": "tsc -p ./ --noEmit"
37
37
  },
38
38
  "dependencies": {
39
39
  "@contentful/f36-components": "^6.7.1",
40
40
  "@contentful/f36-tokens": "^6.1.2",
41
- "@contentful/field-editor-shared": "^4.3.1-canary.0+72ee3709",
41
+ "@contentful/field-editor-shared": "^4.4.1-canary.5+3e29f973",
42
42
  "@emotion/css": "^11.13.5"
43
43
  },
44
44
  "devDependencies": {
45
- "@contentful/field-editor-test-utils": "^3.0.1-canary.32+72ee3709"
45
+ "@contentful/field-editor-test-utils": "^3.1.1-canary.5+3e29f973"
46
46
  },
47
47
  "peerDependencies": {
48
48
  "react": ">=18.3.1",
@@ -51,5 +51,5 @@
51
51
  "publishConfig": {
52
52
  "registry": "https://npm.pkg.github.com/"
53
53
  },
54
- "gitHead": "72ee370988fabd25720deff8861b5a2620da0b5a"
54
+ "gitHead": "3e29f9734b46d8ca738457c87cc76a0aeca459e9"
55
55
  }