Skip to content

Commit cabfb93

Browse files
committed
test times reduced
1 parent e3e80e6 commit cabfb93

11 files changed

Lines changed: 3 additions & 62 deletions

File tree

src/livePreview/__test__/live-preview.test.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,6 @@ const TITLE_CSLP_TAG = "content-type-1.entry-uid-1.en-us.field-title";
5353
const DESC_CSLP_TAG = "content-type-2.entry-uid-2.en-us.field-description";
5454
const LINK_CSLP_TAG = "content-type-3.entry-uid-3.en-us.field-link";
5555

56-
global.ResizeObserver = vi.fn().mockImplementation(() => ({
57-
observe: vi.fn(),
58-
unobserve: vi.fn(),
59-
disconnect: vi.fn(),
60-
}));
61-
6256
describe("cslp tooltip", () => {
6357
beforeEach(() => {
6458
Config.reset();

src/livePreview/editButton/__test__/editButtonAction.test.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,6 @@ const VARIANT_TITLE_CSLP_TAG =
2323
const DESC_CSLP_TAG = "content-type-2.entry-uid-2.en-us.field-description";
2424
const LINK_CSLP_TAG = "content-type-3.entry-uid-3.en-us.field-link";
2525

26-
global.ResizeObserver = vi.fn().mockImplementation(() => ({
27-
observe: vi.fn(),
28-
unobserve: vi.fn(),
29-
disconnect: vi.fn(),
30-
}));
31-
3226
describe("cslp tooltip", () => {
3327
beforeEach(() => {
3428
Config.reset();

src/preview/__test__/contentstack-live-preview-HOC.test.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,6 @@ Object.defineProperty(globalThis, "crypto", {
2222
},
2323
});
2424

25-
global.ResizeObserver = vi.fn().mockImplementation(() => ({
26-
observe: vi.fn(),
27-
unobserve: vi.fn(),
28-
disconnect: vi.fn(),
29-
}));
30-
3125
describe("Live Preview HOC init", () => {
3226
beforeEach(() => {
3327
Config.reset();

src/visualBuilder/__test__/click/fields/all-click.test.tsx

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,6 @@ import { VisualBuilderPostMessageEvents } from "../../../utils/types/postMessage
3838
import { VisualBuilder } from "../../../index";
3939
import { triggerAndWaitForClickAction } from "../../../../__test__/utils";
4040

41-
global.ResizeObserver = vi.fn().mockImplementation(() => ({
42-
observe: vi.fn(),
43-
unobserve: vi.fn(),
44-
disconnect: vi.fn(),
45-
}));
46-
4741
global.MutationObserver = vi.fn().mockImplementation(() => ({
4842
observe: vi.fn(),
4943
disconnect: vi.fn(),

src/visualBuilder/__test__/hover/fields/all-hover.test.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -86,12 +86,6 @@ vi.mock("../../../../utils/index.ts", async () => {
8686
};
8787
});
8888

89-
global.ResizeObserver = vi.fn().mockImplementation(() => ({
90-
observe: vi.fn(),
91-
unobserve: vi.fn(),
92-
disconnect: vi.fn(),
93-
}));
94-
9589
// Test only representative field types - E2E tests cover all field types and their icons
9690
// Single field (no multiple support) - boolean represents this pattern
9791
const SINGLE_FIELD = {

src/visualBuilder/__test__/hover/fields/file.test.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,6 @@ describe("When an element is hovered in visual builder mode", () => {
8787
"all_fields",
8888
getFieldSchemaMap().all_fields
8989
);
90-
global.ResizeObserver = vi.fn().mockImplementation(() => ({
91-
observe: vi.fn(),
92-
unobserve: vi.fn(),
93-
disconnect: vi.fn(),
94-
}));
9590

9691
global.MutationObserver = vi.fn().mockImplementation(() => ({
9792
observe: vi.fn(),

src/visualBuilder/__test__/hover/fields/group.test.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,6 @@ vi.mock("../../../utils/visualBuilderPostMessage", async () => {
2828
};
2929
});
3030

31-
global.ResizeObserver = vi.fn().mockImplementation(() => ({
32-
observe: vi.fn(),
33-
unobserve: vi.fn(),
34-
disconnect: vi.fn(),
35-
}));
36-
3731
vi.mock("../../../../utils/index.ts", async () => {
3832
const actual = await vi.importActual("../../../../utils");
3933
return {

src/visualBuilder/__test__/hover/fields/single-line.test.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,6 @@ vi.mock("../../../utils/visualBuilderPostMessage", async () => {
2525
};
2626
});
2727

28-
global.ResizeObserver = vi.fn().mockImplementation(() => ({
29-
observe: vi.fn(),
30-
unobserve: vi.fn(),
31-
disconnect: vi.fn(),
32-
}));
33-
3428
vi.mock("../../../../utils/index.ts", async () => {
3529
const actual = await vi.importActual("../../../../utils");
3630
return {

src/visualBuilder/__test__/withoutIframe.test.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,6 @@ Object.defineProperty(globalThis, "crypto", {
4747
},
4848
});
4949

50-
global.ResizeObserver = vi.fn().mockImplementation(() => ({
51-
observe: vi.fn(),
52-
unobserve: vi.fn(),
53-
disconnect: vi.fn(),
54-
}));
55-
5650
describe("When outside the Visual Builder, the Visual Builder", () => {
5751
beforeAll(() => {
5852
Config.set("mode", 2);

src/visualBuilder/generators/__test__/generateToolbar.test.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,6 @@ import { singleLineFieldSchema } from "../../../__test__/data/fields";
1010

1111
const MOCK_CSLP = "all_fields.bltapikey.en-us.single_line";
1212

13-
global.ResizeObserver = vi.fn().mockImplementation(() => ({
14-
observe: vi.fn(),
15-
unobserve: vi.fn(),
16-
disconnect: vi.fn(),
17-
}));
18-
1913
vi.mock("../../utils/fetchEntryPermissionsAndStageDetails", () => ({
2014
fetchEntryPermissionsAndStageDetails: async () => ({
2115
acl: {

0 commit comments

Comments
 (0)