@dynatrace/strato-components-testing 3.3.3 → 3.4.1

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.
@@ -9,6 +9,7 @@ function setupIntersectionObserverMock(entries = [
9
9
  class MockIntersectionObserver {
10
10
  root = null;
11
11
  rootMargin = "";
12
+ scrollMargin = "";
12
13
  thresholds = [];
13
14
  callback;
14
15
  /**
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/jest/mocks/intersection-observer-mock.ts"],
4
- "sourcesContent": ["// eslint-disable-next-line no-restricted-imports\nimport { jest } from '@jest/globals';\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\n\nconst pristineIntersectionObserver = window.IntersectionObserver;\n\n/**\n * Mocks the IntersectionObserver\n * @param entries - entries for the callback function which is called when IntersectionObserver.observe is invoked\n * @public\n */\nexport function setupIntersectionObserverMock(\n entries: any = [\n {\n isIntersecting: true,\n intersectionRatio: 1,\n },\n ],\n) {\n class MockIntersectionObserver implements IntersectionObserver {\n readonly root = null;\n readonly rootMargin: string = '';\n readonly thresholds: ReadonlyArray<number> = [];\n readonly callback;\n\n /**\n * Mock constructor\n * @param callback - callback function\n * @param options - options\n */\n constructor(callback: any, options?: any) {\n this.callback = callback;\n }\n\n disconnect: () => void = jest.fn();\n observe: (target: Element) => void = jest.fn(() => this.callback(entries));\n takeRecords: () => IntersectionObserverEntry[] =\n jest.fn<() => IntersectionObserverEntry[]>();\n unobserve: (target: Element) => void = jest.fn();\n }\n\n Object.defineProperty(global, 'IntersectionObserver', {\n writable: true,\n configurable: true,\n value: MockIntersectionObserver,\n });\n}\n\n/**\n * Clears `IntersectionObserver` mock.\n * @public\n */\nexport function clearIntersectionObserverMock() {\n global.IntersectionObserver = pristineIntersectionObserver;\n}\n"],
5
- "mappings": "AACA,SAAS,YAAY;AAIrB,MAAM,+BAA+B,OAAO;AAOrC,SAAS,8BACd,UAAe;AAAA,EACb;AAAA,IACE,gBAAgB;AAAA,IAChB,mBAAmB;AAAA,EACrB;AACF,GACA;AAAA,EACA,MAAM,yBAAyD;AAAA,IACpD,OAAO;AAAA,IACP,aAAqB;AAAA,IACrB,aAAoC,CAAC;AAAA,IACrC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOT,YAAY,UAAe,SAAe;AACxC,WAAK,WAAW;AAAA,IAClB;AAAA,IAEA,aAAyB,KAAK,GAAG;AAAA,IACjC,UAAqC,KAAK,GAAG,MAAM,KAAK,SAAS,OAAO,CAAC;AAAA,IACzE,cACE,KAAK,GAAsC;AAAA,IAC7C,YAAuC,KAAK,GAAG;AAAA,EACjD;AAEA,SAAO,eAAe,QAAQ,wBAAwB;AAAA,IACpD,UAAU;AAAA,IACV,cAAc;AAAA,IACd,OAAO;AAAA,EACT,CAAC;AACH;AAMO,SAAS,gCAAgC;AAC9C,SAAO,uBAAuB;AAChC;",
4
+ "sourcesContent": ["// eslint-disable-next-line no-restricted-imports\nimport { jest } from '@jest/globals';\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\n\nconst pristineIntersectionObserver = window.IntersectionObserver;\n\n/**\n * Mocks the IntersectionObserver\n * @param entries - entries for the callback function which is called when IntersectionObserver.observe is invoked\n * @public\n */\nexport function setupIntersectionObserverMock(\n entries: any = [\n {\n isIntersecting: true,\n intersectionRatio: 1,\n },\n ],\n) {\n class MockIntersectionObserver implements IntersectionObserver {\n readonly root = null;\n readonly rootMargin: string = '';\n readonly scrollMargin: string = '';\n readonly thresholds: ReadonlyArray<number> = [];\n readonly callback;\n\n /**\n * Mock constructor\n * @param callback - callback function\n * @param options - options\n */\n constructor(callback: any, options?: any) {\n this.callback = callback;\n }\n\n disconnect: () => void = jest.fn();\n observe: (target: Element) => void = jest.fn(() => this.callback(entries));\n takeRecords: () => IntersectionObserverEntry[] =\n jest.fn<() => IntersectionObserverEntry[]>();\n unobserve: (target: Element) => void = jest.fn();\n }\n\n Object.defineProperty(global, 'IntersectionObserver', {\n writable: true,\n configurable: true,\n value: MockIntersectionObserver,\n });\n}\n\n/**\n * Clears `IntersectionObserver` mock.\n * @public\n */\nexport function clearIntersectionObserverMock() {\n global.IntersectionObserver = pristineIntersectionObserver;\n}\n"],
5
+ "mappings": "AACA,SAAS,YAAY;AAIrB,MAAM,+BAA+B,OAAO;AAOrC,SAAS,8BACd,UAAe;AAAA,EACb;AAAA,IACE,gBAAgB;AAAA,IAChB,mBAAmB;AAAA,EACrB;AACF,GACA;AAAA,EACA,MAAM,yBAAyD;AAAA,IACpD,OAAO;AAAA,IACP,aAAqB;AAAA,IACrB,eAAuB;AAAA,IACvB,aAAoC,CAAC;AAAA,IACrC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOT,YAAY,UAAe,SAAe;AACxC,WAAK,WAAW;AAAA,IAClB;AAAA,IAEA,aAAyB,KAAK,GAAG;AAAA,IACjC,UAAqC,KAAK,GAAG,MAAM,KAAK,SAAS,OAAO,CAAC;AAAA,IACzE,cACE,KAAK,GAAsC;AAAA,IAC7C,YAAuC,KAAK,GAAG;AAAA,EACjD;AAEA,SAAO,eAAe,QAAQ,wBAAwB;AAAA,IACpD,UAAU;AAAA,IACV,cAAc;AAAA,IACd,OAAO;AAAA,EACT,CAAC;AACH;AAMO,SAAS,gCAAgC;AAC9C,SAAO,uBAAuB;AAChC;",
6
6
  "names": []
7
7
  }
@@ -32,6 +32,7 @@ function setupIntersectionObserverMock(entries = [
32
32
  class MockIntersectionObserver {
33
33
  root = null;
34
34
  rootMargin = "";
35
+ scrollMargin = "";
35
36
  thresholds = [];
36
37
  callback;
37
38
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynatrace/strato-components-testing",
3
- "version": "3.3.3",
3
+ "version": "3.4.1",
4
4
  "private": false,
5
5
  "license": "Apache-2.0",
6
6
  "types": "./index.d.ts",
@@ -37,7 +37,7 @@
37
37
  }
38
38
  },
39
39
  "peerDependencies": {
40
- "@dynatrace/strato-components": "^3.3.3",
40
+ "@dynatrace/strato-components": "^3.4.1",
41
41
  "@testing-library/react": "^16.0.0",
42
42
  "@testing-library/user-event": "^14.0.0",
43
43
  "framer-motion": "^11.3.19 || ^12.0.0",