@atlaskit/media-test-helpers 33.0.36 → 34.0.0

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # @atlaskit/media-test-helpers
2
2
 
3
+ ## 34.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - [#121438](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/121438)
8
+ [`6fc64e2707215`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/6fc64e2707215) -
9
+ Removed exports createRateLimitedError, createPollingMaxAttemptsError & createMediaStoreError. Now
10
+ they are exposed from @atlaskit/media-client/test-helpers
11
+
12
+ ### Patch Changes
13
+
14
+ - Updated dependencies
15
+
3
16
  ## 33.0.36
4
17
 
5
18
  ### Patch Changes
package/dist/cjs/index.js CHANGED
@@ -209,30 +209,12 @@ Object.defineProperty(exports, "createIdentifier", {
209
209
  return _fileStateFactory.createIdentifier;
210
210
  }
211
211
  });
212
- Object.defineProperty(exports, "createMediaStoreError", {
213
- enumerable: true,
214
- get: function get() {
215
- return _mediaClientErrors.createMediaStoreError;
216
- }
217
- });
218
212
  Object.defineProperty(exports, "createMouseEvent", {
219
213
  enumerable: true,
220
214
  get: function get() {
221
215
  return _createMouseEvent.createMouseEvent;
222
216
  }
223
217
  });
224
- Object.defineProperty(exports, "createPollingMaxAttemptsError", {
225
- enumerable: true,
226
- get: function get() {
227
- return _mediaClientErrors.createPollingMaxAttemptsError;
228
- }
229
- });
230
- Object.defineProperty(exports, "createRateLimitedError", {
231
- enumerable: true,
232
- get: function get() {
233
- return _mediaClientErrors.createRateLimitedError;
234
- }
235
- });
236
218
  Object.defineProperty(exports, "createStorybookMediaClient", {
237
219
  enumerable: true,
238
220
  get: function get() {
@@ -905,7 +887,6 @@ var _MockGlobalImage = require("./MockGlobalImage");
905
887
  var _exampleMediaFeatureFlags = require("./example-mediaFeatureFlags");
906
888
  var _utils = require("./mockData/utils");
907
889
  var _index = require("./utils/index");
908
- var _mediaClientErrors = require("./mediaClientErrors");
909
890
  var _featureFlagsWrapper = _interopRequireDefault(require("./featureFlagsWrapper"));
910
891
  var _fileStateFactory = require("./fileStateFactory");
911
892
  var _docsContentTabs = require("./docs-content-tabs");
@@ -35,7 +35,6 @@ export { enableMockGlobalImage, disableMockGlobalImage } from './MockGlobalImage
35
35
  export { exampleMediaFeatureFlags } from './example-mediaFeatureFlags';
36
36
  export { dataURItoBlob } from './mockData/utils';
37
37
  export { mapDataUriToBlob } from './utils/index';
38
- export { createPollingMaxAttemptsError, createRateLimitedError, createMediaStoreError } from './mediaClientErrors';
39
38
  export { default as FeatureFlagsWrapper } from './featureFlagsWrapper';
40
39
  export {
41
40
  // Simulation tools
package/dist/esm/index.js CHANGED
@@ -35,7 +35,6 @@ export { enableMockGlobalImage, disableMockGlobalImage } from './MockGlobalImage
35
35
  export { exampleMediaFeatureFlags } from './example-mediaFeatureFlags';
36
36
  export { dataURItoBlob } from './mockData/utils';
37
37
  export { mapDataUriToBlob } from './utils/index';
38
- export { createPollingMaxAttemptsError, createRateLimitedError, createMediaStoreError } from './mediaClientErrors';
39
38
  export { default as FeatureFlagsWrapper } from './featureFlagsWrapper';
40
39
  export {
41
40
  // Simulation tools
@@ -41,7 +41,6 @@ export { enableMockGlobalImage, disableMockGlobalImage } from './MockGlobalImage
41
41
  export { exampleMediaFeatureFlags } from './example-mediaFeatureFlags';
42
42
  export { dataURItoBlob } from './mockData/utils';
43
43
  export { mapDataUriToBlob } from './utils/index';
44
- export { createPollingMaxAttemptsError, createRateLimitedError, createMediaStoreError, } from './mediaClientErrors';
45
44
  export { default as FeatureFlagsWrapper } from './featureFlagsWrapper';
46
45
  export { FileStateFactory, MediaClientMock, createIdentifier, createFileDetails, createFileState, useRunSimulation, simulateProcessed, simulateProcessing, simulateImmediateFailProcessing, simulateUpload, simulateError, simulateErrorState, simulateManyProcessed, simulateEmptyDetails, simulateUpdateFileId, simulateAlwaysLoading, simulateAlwaysProcessing, } from './fileStateFactory';
47
46
  export type { FileStateFactoryOptions, MediaClientMockOptions, Simulation, SimulationUtils, SimulationSettings, SimulationFactory, StandardSimulation, } from './fileStateFactory';
@@ -1,7 +1,7 @@
1
1
  /// <reference types="jest" />
2
2
  export declare const asMock: (fn: Function) => jest.Mock;
3
3
  export declare const asMockFunction: <T extends (...args: any[]) => any>(fn: T) => jest.MockedFunction<T>;
4
- export declare const asMockReturnValue: <T extends (...args: any[]) => any>(fn: T, returnValue: ReturnType<T>) => jest.Mock<any, any>;
4
+ export declare const asMockReturnValue: <T extends (...args: any[]) => any>(fn: T, returnValue: ReturnType<T>) => jest.Mock<any, any, any>;
5
5
  export declare const asMockFunctionReturnValue: <T extends (...args: any[]) => any>(fn: T, returnValue: ReturnType<T>) => jest.MockedFunction<T>;
6
6
  export declare const asMockFunctionResolvedValue: <T extends (...args: any[]) => any>(fn: T, resolveValue: jest.ResolvedValue<ReturnType<T>>) => jest.MockedFunction<T>;
7
7
  export declare const expectToEqual: <T>(actual: T, expected: T) => void;
@@ -3,7 +3,7 @@ export declare function mockCanvas(width?: number, height?: number): {
3
3
  canvas: {
4
4
  width: number;
5
5
  height: number;
6
- toDataURL: jest.Mock<any, any> | import("./getJest").MockStub<unknown, unknown>;
6
+ toDataURL: jest.Mock<any, any, any> | import("./getJest").MockStub<unknown, unknown>;
7
7
  getContext: unknown;
8
8
  };
9
9
  context: Partial<CanvasRenderingContext2D>;
@@ -41,7 +41,6 @@ export { enableMockGlobalImage, disableMockGlobalImage } from './MockGlobalImage
41
41
  export { exampleMediaFeatureFlags } from './example-mediaFeatureFlags';
42
42
  export { dataURItoBlob } from './mockData/utils';
43
43
  export { mapDataUriToBlob } from './utils/index';
44
- export { createPollingMaxAttemptsError, createRateLimitedError, createMediaStoreError, } from './mediaClientErrors';
45
44
  export { default as FeatureFlagsWrapper } from './featureFlagsWrapper';
46
45
  export { FileStateFactory, MediaClientMock, createIdentifier, createFileDetails, createFileState, useRunSimulation, simulateProcessed, simulateProcessing, simulateImmediateFailProcessing, simulateUpload, simulateError, simulateErrorState, simulateManyProcessed, simulateEmptyDetails, simulateUpdateFileId, simulateAlwaysLoading, simulateAlwaysProcessing, } from './fileStateFactory';
47
46
  export type { FileStateFactoryOptions, MediaClientMockOptions, Simulation, SimulationUtils, SimulationSettings, SimulationFactory, StandardSimulation, } from './fileStateFactory';
@@ -1,7 +1,7 @@
1
1
  /// <reference types="jest" />
2
2
  export declare const asMock: (fn: Function) => jest.Mock;
3
3
  export declare const asMockFunction: <T extends (...args: any[]) => any>(fn: T) => jest.MockedFunction<T>;
4
- export declare const asMockReturnValue: <T extends (...args: any[]) => any>(fn: T, returnValue: ReturnType<T>) => jest.Mock<any, any>;
4
+ export declare const asMockReturnValue: <T extends (...args: any[]) => any>(fn: T, returnValue: ReturnType<T>) => jest.Mock<any, any, any>;
5
5
  export declare const asMockFunctionReturnValue: <T extends (...args: any[]) => any>(fn: T, returnValue: ReturnType<T>) => jest.MockedFunction<T>;
6
6
  export declare const asMockFunctionResolvedValue: <T extends (...args: any[]) => any>(fn: T, resolveValue: jest.ResolvedValue<ReturnType<T>>) => jest.MockedFunction<T>;
7
7
  export declare const expectToEqual: <T>(actual: T, expected: T) => void;
@@ -3,7 +3,7 @@ export declare function mockCanvas(width?: number, height?: number): {
3
3
  canvas: {
4
4
  width: number;
5
5
  height: number;
6
- toDataURL: jest.Mock<any, any> | import("./getJest").MockStub<unknown, unknown>;
6
+ toDataURL: jest.Mock<any, any, any> | import("./getJest").MockStub<unknown, unknown>;
7
7
  getContext: unknown;
8
8
  };
9
9
  context: Partial<CanvasRenderingContext2D>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/media-test-helpers",
3
- "version": "33.0.36",
3
+ "version": "34.0.0",
4
4
  "description": "Collection of test helpers used in media component stories and specs",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -27,17 +27,17 @@
27
27
  "releaseModel": "continuous"
28
28
  },
29
29
  "dependencies": {
30
- "@atlaskit/button": "^18.0.0",
30
+ "@atlaskit/button": "^19.0.0",
31
31
  "@atlaskit/checkbox": "^13.5.0",
32
- "@atlaskit/icon": "^22.4.0",
32
+ "@atlaskit/icon": "^22.6.0",
33
33
  "@atlaskit/locale": "^2.7.0",
34
34
  "@atlaskit/media-client": "^27.3.0",
35
35
  "@atlaskit/media-common": "^11.3.0",
36
36
  "@atlaskit/media-ui": "^25.10.0",
37
- "@atlaskit/popup": "^1.19.0",
38
- "@atlaskit/tabs": "^16.2.0",
37
+ "@atlaskit/popup": "^1.20.0",
38
+ "@atlaskit/tabs": "^16.3.0",
39
39
  "@atlaskit/textfield": "^6.4.0",
40
- "@atlaskit/tokens": "^1.52.0",
40
+ "@atlaskit/tokens": "^1.56.0",
41
41
  "@atlaskit/tooltip": "^18.5.0",
42
42
  "@atlaskit/ufo": "^0.2.0",
43
43
  "@babel/runtime": "^7.0.0",
@@ -1,24 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.createRateLimitedError = exports.createPollingMaxAttemptsError = exports.createMediaStoreError = void 0;
8
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
- var _mediaClient = require("@atlaskit/media-client");
10
- function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
11
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
12
- var createRateLimitedError = exports.createRateLimitedError = function createRateLimitedError() {
13
- var metadata = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
14
- return new _mediaClient.RequestError('serverRateLimited', _objectSpread(_objectSpread({}, metadata), {}, {
15
- statusCode: 429
16
- }));
17
- };
18
- var createPollingMaxAttemptsError = exports.createPollingMaxAttemptsError = function createPollingMaxAttemptsError() {
19
- var attempts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;
20
- return new _mediaClient.PollingError('pollingMaxAttemptsExceeded', attempts);
21
- };
22
- var createMediaStoreError = exports.createMediaStoreError = function createMediaStoreError() {
23
- return new _mediaClient.MediaStoreError('missingInitialAuth');
24
- };
@@ -1,7 +0,0 @@
1
- import { RequestError, PollingError, MediaStoreError } from '@atlaskit/media-client';
2
- export const createRateLimitedError = (metadata = {}) => new RequestError('serverRateLimited', {
3
- ...metadata,
4
- statusCode: 429
5
- });
6
- export const createPollingMaxAttemptsError = (attempts = 1) => new PollingError('pollingMaxAttemptsExceeded', attempts);
7
- export const createMediaStoreError = () => new MediaStoreError('missingInitialAuth');
@@ -1,17 +0,0 @@
1
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
- function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
- import { RequestError, PollingError, MediaStoreError } from '@atlaskit/media-client';
5
- export var createRateLimitedError = function createRateLimitedError() {
6
- var metadata = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
7
- return new RequestError('serverRateLimited', _objectSpread(_objectSpread({}, metadata), {}, {
8
- statusCode: 429
9
- }));
10
- };
11
- export var createPollingMaxAttemptsError = function createPollingMaxAttemptsError() {
12
- var attempts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;
13
- return new PollingError('pollingMaxAttemptsExceeded', attempts);
14
- };
15
- export var createMediaStoreError = function createMediaStoreError() {
16
- return new MediaStoreError('missingInitialAuth');
17
- };
@@ -1,4 +0,0 @@
1
- import { RequestError, type RequestErrorMetadata, PollingError, MediaStoreError } from '@atlaskit/media-client';
2
- export declare const createRateLimitedError: (metadata?: RequestErrorMetadata) => RequestError;
3
- export declare const createPollingMaxAttemptsError: (attempts?: number) => PollingError;
4
- export declare const createMediaStoreError: () => MediaStoreError;
@@ -1,4 +0,0 @@
1
- import { RequestError, type RequestErrorMetadata, PollingError, MediaStoreError } from '@atlaskit/media-client';
2
- export declare const createRateLimitedError: (metadata?: RequestErrorMetadata) => RequestError;
3
- export declare const createPollingMaxAttemptsError: (attempts?: number) => PollingError;
4
- export declare const createMediaStoreError: () => MediaStoreError;