@atlaskit/media-test-helpers 41.2.0 → 42.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/AGENTS.md +58 -0
- package/CHANGELOG.md +26 -0
- package/I18nWrapper/package.json +1 -8
- package/MockGlobalImage/package.json +1 -8
- package/authProvider/package.json +1 -8
- package/await-error/package.json +1 -8
- package/clipboardEventMocks/package.json +1 -8
- package/collectionNames/package.json +1 -8
- package/createFileState/package.json +1 -8
- package/createMouseEvent/package.json +1 -8
- package/createTouchEvent/package.json +1 -8
- package/dist/cjs/authProvider.js +6 -6
- package/dist/cjs/await-error.js +13 -12
- package/dist/cjs/fileStateFactory/factory/factory.js +7 -7
- package/dist/cjs/fileStateFactory/fileSimulation/simulations.js +66 -66
- package/dist/cjs/getAuthFromContextProvider.js +4 -4
- package/dist/cjs/getMediaAuthProvider.js +4 -4
- package/dist/cjs/mediaPickerAuthProvider.js +4 -4
- package/dist/cjs/mocks/routers/api-router.js +11 -11
- package/dist/cjs/waitUntil.js +2 -2
- package/dist/esm/authProvider.js +6 -6
- package/dist/esm/await-error.js +13 -12
- package/dist/esm/fileStateFactory/factory/factory.js +7 -7
- package/dist/esm/fileStateFactory/fileSimulation/simulations.js +66 -66
- package/dist/esm/getAuthFromContextProvider.js +4 -4
- package/dist/esm/getMediaAuthProvider.js +4 -4
- package/dist/esm/mediaPickerAuthProvider.js +4 -4
- package/dist/esm/mocks/routers/api-router.js +11 -11
- package/dist/esm/waitUntil.js +2 -2
- package/docs-content-tabs/package.json +1 -8
- package/exampleMediaFeatureFlags/package.json +1 -8
- package/exampleMediaItems/package.json +1 -8
- package/factory/package.json +1 -8
- package/fakeI18n/package.json +1 -8
- package/fakeMediaClient/package.json +1 -8
- package/featureFlagsWrapper/package.json +1 -8
- package/fileReader/package.json +1 -8
- package/fileSimulation/package.json +1 -8
- package/flushPromises/package.json +1 -8
- package/getAuthFromContextProvider/package.json +1 -8
- package/getMediaAuthProvider/package.json +1 -8
- package/globalEventEmitterListeners/package.json +1 -8
- package/helpers/package.json +1 -8
- package/images/package.json +1 -8
- package/jestHelpers/package.json +1 -8
- package/keyboardEventWithKeyCode/package.json +1 -8
- package/media-mock/package.json +1 -8
- package/mediaBaseURLS/package.json +1 -8
- package/mediaClientProvider/package.json +1 -8
- package/mediaPickerAuthProvider/package.json +1 -8
- package/mock-data-utils/package.json +1 -8
- package/mockCanvas/package.json +1 -8
- package/mockData/package.json +1 -8
- package/mockLoadImage/package.json +1 -8
- package/nextTick/package.json +1 -8
- package/package.json +20 -28
- package/renderWithIntl/package.json +1 -8
- package/simulations/package.json +1 -8
- package/smallImageURI/package.json +1 -8
- package/smallTransparentImageURI/package.json +1 -8
- package/smart-card-state/package.json +1 -8
- package/story-list/package.json +1 -8
- package/story-styles/package.json +1 -8
- package/tallImageURI/package.json +1 -8
- package/timeoutPromise/package.json +1 -8
- package/ufoLogger/package.json +1 -8
- package/utils/package.json +1 -8
- package/videoPreviewURI/package.json +1 -8
- package/videoURI/package.json +1 -8
- package/vr-test-small-image/package.json +1 -8
- package/waitUntil/package.json +1 -8
- package/wideImageURI/package.json +1 -8
- package/wideTransparentImageURI/package.json +1 -8
- package/dist/types-ts4.5/I18nWrapper.d.ts +0 -10
- package/dist/types-ts4.5/MockGlobalImage.d.ts +0 -2
- package/dist/types-ts4.5/authProvider.d.ts +0 -6
- package/dist/types-ts4.5/await-error.d.ts +0 -1
- package/dist/types-ts4.5/clipboardEventMocks.d.ts +0 -122
- package/dist/types-ts4.5/collectionNames.d.ts +0 -5
- package/dist/types-ts4.5/createMouseEvent.d.ts +0 -8
- package/dist/types-ts4.5/createTouchEvent.d.ts +0 -4
- package/dist/types-ts4.5/dataURIs/smallImageURI.d.ts +0 -1
- package/dist/types-ts4.5/dataURIs/smallTransparentImageURI.d.ts +0 -1
- package/dist/types-ts4.5/dataURIs/tallImageURI.d.ts +0 -1
- package/dist/types-ts4.5/dataURIs/videoPreviewURI.d.ts +0 -1
- package/dist/types-ts4.5/dataURIs/videoURI.d.ts +0 -1
- package/dist/types-ts4.5/dataURIs/vr_test_small_image.d.ts +0 -1
- package/dist/types-ts4.5/dataURIs/wideImageURI.d.ts +0 -1
- package/dist/types-ts4.5/dataURIs/wideTransparentImageURI.d.ts +0 -1
- package/dist/types-ts4.5/docs-content-tabs.d.ts +0 -14
- package/dist/types-ts4.5/example-mediaFeatureFlags.d.ts +0 -2
- package/dist/types-ts4.5/exampleMediaItems.d.ts +0 -56
- package/dist/types-ts4.5/fakeI18n.d.ts +0 -1
- package/dist/types-ts4.5/fakeMediaClient.d.ts +0 -4
- package/dist/types-ts4.5/featureFlagsWrapper/dropdown.d.ts +0 -6
- package/dist/types-ts4.5/featureFlagsWrapper/helpers.d.ts +0 -5
- package/dist/types-ts4.5/featureFlagsWrapper/index.d.ts +0 -5
- package/dist/types-ts4.5/fileReader.d.ts +0 -19
- package/dist/types-ts4.5/fileStateFactory/factory/createFileState.d.ts +0 -10
- package/dist/types-ts4.5/fileStateFactory/factory/factory.d.ts +0 -45
- package/dist/types-ts4.5/fileStateFactory/factory/helpers.d.ts +0 -7
- package/dist/types-ts4.5/fileStateFactory/factory/index.d.ts +0 -4
- package/dist/types-ts4.5/fileStateFactory/fileSimulation/fileSimulation.d.ts +0 -18
- package/dist/types-ts4.5/fileStateFactory/fileSimulation/index.d.ts +0 -4
- package/dist/types-ts4.5/fileStateFactory/fileSimulation/simulations.d.ts +0 -36
- package/dist/types-ts4.5/fileStateFactory/index.d.ts +0 -8
- package/dist/types-ts4.5/flushPromises.d.ts +0 -2
- package/dist/types-ts4.5/getAuthFromContextProvider.d.ts +0 -1
- package/dist/types-ts4.5/getJest.d.ts +0 -15
- package/dist/types-ts4.5/getMediaAuthProvider.d.ts +0 -3
- package/dist/types-ts4.5/globalEventEmitterListeners.d.ts +0 -1
- package/dist/types-ts4.5/images.d.ts +0 -7
- package/dist/types-ts4.5/index.d.ts +0 -48
- package/dist/types-ts4.5/jestHelpers.d.ts +0 -12
- package/dist/types-ts4.5/keyboardEventWithKeyCode.d.ts +0 -2
- package/dist/types-ts4.5/mediaBaseURLS.d.ts +0 -2
- package/dist/types-ts4.5/mediaClientProvider.d.ts +0 -23
- package/dist/types-ts4.5/mediaPickerAuthProvider.d.ts +0 -3
- package/dist/types-ts4.5/mockCanvas.d.ts +0 -10
- package/dist/types-ts4.5/mockData/handlers/copyWithToken.d.ts +0 -3
- package/dist/types-ts4.5/mockData/handlers/getFile.d.ts +0 -3
- package/dist/types-ts4.5/mockData/handlers/getFileImage.d.ts +0 -3
- package/dist/types-ts4.5/mockData/handlers/index.d.ts +0 -5
- package/dist/types-ts4.5/mockData/handlers/tenantAuth.d.ts +0 -3
- package/dist/types-ts4.5/mockData/handlers/userCollectionFetch.d.ts +0 -3
- package/dist/types-ts4.5/mockData/index.d.ts +0 -50
- package/dist/types-ts4.5/mockData/matchers.d.ts +0 -7
- package/dist/types-ts4.5/mockData/staticCommon.d.ts +0 -4
- package/dist/types-ts4.5/mockData/utils.d.ts +0 -4
- package/dist/types-ts4.5/mockLoadImage.d.ts +0 -4
- package/dist/types-ts4.5/mocks/database/chunk.d.ts +0 -6
- package/dist/types-ts4.5/mocks/database/collection-item.d.ts +0 -29
- package/dist/types-ts4.5/mocks/database/collection.d.ts +0 -5
- package/dist/types-ts4.5/mocks/database/index.d.ts +0 -21
- package/dist/types-ts4.5/mocks/database/upload.d.ts +0 -6
- package/dist/types-ts4.5/mocks/fileAndDirectoriesUtils.d.ts +0 -16
- package/dist/types-ts4.5/mocks/media-mock.d.ts +0 -36
- package/dist/types-ts4.5/mocks/routers/api-router.d.ts +0 -3
- package/dist/types-ts4.5/mocks/routers/index.d.ts +0 -2
- package/dist/types-ts4.5/mocks/routers/media-playground-router.d.ts +0 -3
- package/dist/types-ts4.5/mocks/websockets/index.d.ts +0 -3
- package/dist/types-ts4.5/mocks/websockets/messages.d.ts +0 -34
- package/dist/types-ts4.5/mocks/websockets/remote-upload-server.d.ts +0 -14
- package/dist/types-ts4.5/mocks/websockets/types.d.ts +0 -4
- package/dist/types-ts4.5/nextTick.d.ts +0 -2
- package/dist/types-ts4.5/renderWithIntl.d.ts +0 -7
- package/dist/types-ts4.5/smart-card-state.d.ts +0 -4
- package/dist/types-ts4.5/story-list.d.ts +0 -13
- package/dist/types-ts4.5/story-styles.d.ts +0 -7
- package/dist/types-ts4.5/timeoutPromise.d.ts +0 -1
- package/dist/types-ts4.5/ufoLogger.d.ts +0 -5
- package/dist/types-ts4.5/utils/index.d.ts +0 -2
- package/dist/types-ts4.5/utils/logging.d.ts +0 -23
- package/dist/types-ts4.5/utils/mockData.d.ts +0 -11
- package/dist/types-ts4.5/waitUntil.d.ts +0 -2
package/AGENTS.md
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# media-test-helpers — Agent Guide
|
|
2
|
+
|
|
3
|
+
> **Parent guide:** Always read [`../AGENTS.md`](../AGENTS.md) before working in this package — it
|
|
4
|
+
> contains workspace-wide rules covering platform guidelines, changeset workflow, accessibility
|
|
5
|
+
> standards, and the knowledge index protocol that applies to every Media package.
|
|
6
|
+
|
|
7
|
+
## Package identity
|
|
8
|
+
|
|
9
|
+
| Field | Value |
|
|
10
|
+
| -------- | ------------------------------------------------------------------------------------------------- |
|
|
11
|
+
| NPM name | `@atlaskit/media-test-helpers` |
|
|
12
|
+
| Path | `media-test-helpers/` |
|
|
13
|
+
| Owner | Media Exif |
|
|
14
|
+
| Purpose | Collection of test helpers, mocks, fakes, and utilities used in Media component stories and specs |
|
|
15
|
+
|
|
16
|
+
## Knowledge index
|
|
17
|
+
|
|
18
|
+
> Read, search, edit, investigate, and validate the repository knowledge index at
|
|
19
|
+
> `.agents/knowledge-index/`. ALWAYS use this skill before making ANY repo change, or when exploring
|
|
20
|
+
> the codebase. The knowledge index is the canonical starting point for every coding task in this
|
|
21
|
+
> repo, trigger this skill aggressively whenever the user mentions architecture, conventions,
|
|
22
|
+
> packages, modules, services, build, coding, writing code, APIs, feature flags, testing, or
|
|
23
|
+
> anything similar. Also trigger when "is the knowledge index up to date?" / "update the knowledge
|
|
24
|
+
> index" / "what does the knowledge index say about Y?" — even if they don't say the words
|
|
25
|
+
> "knowledge index". Also use it (via the `validate` subcommand) to detect drift between the
|
|
26
|
+
> codebase and the docs after any code change. Use the `generate` subcommand to bootstrap the index
|
|
27
|
+
> in a new repository.
|
|
28
|
+
|
|
29
|
+
**Entry point:** `.agents/knowledge-index/INDEX.md` **Unit doc:**
|
|
30
|
+
`.agents/knowledge-index/domains/media/units/atlaskit-media-test-helpers.md` **CLI:**
|
|
31
|
+
`python3 .agents/skills/knowledge-index/scripts/kg.py {find,read,edit,investigate,validate,init,explore,generate} …`
|
|
32
|
+
**Refresh protocol:** never silently bump `Last verified` — always re-read the listed `Sources`
|
|
33
|
+
first, edit, then `kg.py edit <path> --message "<reason>"`.
|
|
34
|
+
|
|
35
|
+
## Key source files
|
|
36
|
+
|
|
37
|
+
- `src/index.tsx` — public API entry point
|
|
38
|
+
- `src/fakeMediaClient.ts` — `fakeMediaClient()` factory for tests
|
|
39
|
+
- `src/mockData/` — MSW mock handlers and routers
|
|
40
|
+
- `src/mocks/` — mock database, routers, and WebSocket mocks
|
|
41
|
+
- `src/fileStateFactory/` — `FileState` factories and file simulation
|
|
42
|
+
- `src/dataURIs/` — sample data URIs for image testing
|
|
43
|
+
- `src/featureFlagsWrapper/` — feature flag test wrapper
|
|
44
|
+
- `src/utils/` — shared test utilities
|
|
45
|
+
|
|
46
|
+
## Public API (key exports)
|
|
47
|
+
|
|
48
|
+
`fakeMediaClient`, `StoryBookAuthProvider`, `generateFilesFromTestData`, and 48 total export
|
|
49
|
+
subpaths covering mocks, helpers, factories, and data URIs.
|
|
50
|
+
|
|
51
|
+
## Development notes
|
|
52
|
+
|
|
53
|
+
- Internal dependencies: `@atlaskit/media-client`, `@atlaskit/media-common`,
|
|
54
|
+
`@atlaskit/media-state`, `@atlaskit/media-ui`
|
|
55
|
+
- Peer dependencies: `@atlaskit/media-core`, `react`, `react-intl`
|
|
56
|
+
- 1 feature flag: `should-render-to-parent-should-be-true-media-exif`
|
|
57
|
+
- 48 export subpaths — always use subpath imports rather than the root barrel
|
|
58
|
+
- Uses MSW (Mock Service Worker) for network-level mocking
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,31 @@
|
|
|
1
1
|
# @atlaskit/media-test-helpers
|
|
2
2
|
|
|
3
|
+
## 42.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- [`f2dc9097319f0`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/f2dc9097319f0) - ###
|
|
8
|
+
Dropped support for _legacy_ Typescript 4 types. **Typescript 5 is now the new minimum**.
|
|
9
|
+
|
|
10
|
+
Removes the `typesVersions` property and `dist/types-ts4.5` directory from the dist.
|
|
11
|
+
|
|
12
|
+
Types are now exclusively via the `"types": "dist/types/index.d.ts"` property.
|
|
13
|
+
|
|
14
|
+
```diff
|
|
15
|
+
- "typesVersions": {
|
|
16
|
+
- ">=4.5 <4.9": {
|
|
17
|
+
- "*": [
|
|
18
|
+
- "dist/types-ts4.5/*",
|
|
19
|
+
- "dist/types-ts4.5/index.d.ts"
|
|
20
|
+
- ]
|
|
21
|
+
- }
|
|
22
|
+
- },
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
### Patch Changes
|
|
26
|
+
|
|
27
|
+
- Updated dependencies
|
|
28
|
+
|
|
3
29
|
## 41.2.0
|
|
4
30
|
|
|
5
31
|
### Minor Changes
|
package/I18nWrapper/package.json
CHANGED
|
@@ -6,12 +6,5 @@
|
|
|
6
6
|
"sideEffects": [
|
|
7
7
|
"*.compiled.css"
|
|
8
8
|
],
|
|
9
|
-
"types": "../dist/types/MockGlobalImage.d.ts"
|
|
10
|
-
"typesVersions": {
|
|
11
|
-
">=4.5 <5.9": {
|
|
12
|
-
"*": [
|
|
13
|
-
"../dist/types-ts4.5/MockGlobalImage.d.ts"
|
|
14
|
-
]
|
|
15
|
-
}
|
|
16
|
-
}
|
|
9
|
+
"types": "../dist/types/MockGlobalImage.d.ts"
|
|
17
10
|
}
|
package/await-error/package.json
CHANGED
|
@@ -6,12 +6,5 @@
|
|
|
6
6
|
"sideEffects": [
|
|
7
7
|
"*.compiled.css"
|
|
8
8
|
],
|
|
9
|
-
"types": "../dist/types/clipboardEventMocks.d.ts"
|
|
10
|
-
"typesVersions": {
|
|
11
|
-
">=4.5 <5.9": {
|
|
12
|
-
"*": [
|
|
13
|
-
"../dist/types-ts4.5/clipboardEventMocks.d.ts"
|
|
14
|
-
]
|
|
15
|
-
}
|
|
16
|
-
}
|
|
9
|
+
"types": "../dist/types/clipboardEventMocks.d.ts"
|
|
17
10
|
}
|
|
@@ -6,12 +6,5 @@
|
|
|
6
6
|
"sideEffects": [
|
|
7
7
|
"*.compiled.css"
|
|
8
8
|
],
|
|
9
|
-
"types": "../dist/types/collectionNames.d.ts"
|
|
10
|
-
"typesVersions": {
|
|
11
|
-
">=4.5 <5.9": {
|
|
12
|
-
"*": [
|
|
13
|
-
"../dist/types-ts4.5/collectionNames.d.ts"
|
|
14
|
-
]
|
|
15
|
-
}
|
|
16
|
-
}
|
|
9
|
+
"types": "../dist/types/collectionNames.d.ts"
|
|
17
10
|
}
|
|
@@ -6,12 +6,5 @@
|
|
|
6
6
|
"sideEffects": [
|
|
7
7
|
"*.compiled.css"
|
|
8
8
|
],
|
|
9
|
-
"types": "../dist/types/fileStateFactory/factory/createFileState.d.ts"
|
|
10
|
-
"typesVersions": {
|
|
11
|
-
">=4.5 <5.9": {
|
|
12
|
-
"*": [
|
|
13
|
-
"../dist/types-ts4.5/fileStateFactory/factory/createFileState.d.ts"
|
|
14
|
-
]
|
|
15
|
-
}
|
|
16
|
-
}
|
|
9
|
+
"types": "../dist/types/fileStateFactory/factory/createFileState.d.ts"
|
|
17
10
|
}
|
|
@@ -6,12 +6,5 @@
|
|
|
6
6
|
"sideEffects": [
|
|
7
7
|
"*.compiled.css"
|
|
8
8
|
],
|
|
9
|
-
"types": "../dist/types/createMouseEvent.d.ts"
|
|
10
|
-
"typesVersions": {
|
|
11
|
-
">=4.5 <5.9": {
|
|
12
|
-
"*": [
|
|
13
|
-
"../dist/types-ts4.5/createMouseEvent.d.ts"
|
|
14
|
-
]
|
|
15
|
-
}
|
|
16
|
-
}
|
|
9
|
+
"types": "../dist/types/createMouseEvent.d.ts"
|
|
17
10
|
}
|
|
@@ -6,12 +6,5 @@
|
|
|
6
6
|
"sideEffects": [
|
|
7
7
|
"*.compiled.css"
|
|
8
8
|
],
|
|
9
|
-
"types": "../dist/types/createTouchEvent.d.ts"
|
|
10
|
-
"typesVersions": {
|
|
11
|
-
">=4.5 <5.9": {
|
|
12
|
-
"*": [
|
|
13
|
-
"../dist/types-ts4.5/createTouchEvent.d.ts"
|
|
14
|
-
]
|
|
15
|
-
}
|
|
16
|
-
}
|
|
9
|
+
"types": "../dist/types/createTouchEvent.d.ts"
|
|
17
10
|
}
|
package/dist/cjs/authProvider.js
CHANGED
|
@@ -23,7 +23,7 @@ var StoryBookAuthProvider = exports.StoryBookAuthProvider = /*#__PURE__*/functio
|
|
|
23
23
|
var loadTenatAuth = /*#__PURE__*/function () {
|
|
24
24
|
var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(collectionName) {
|
|
25
25
|
var environment, headers, config, url, response;
|
|
26
|
-
return _regenerator.default.wrap(function
|
|
26
|
+
return _regenerator.default.wrap(function (_context) {
|
|
27
27
|
while (1) switch (_context.prev = _context.next) {
|
|
28
28
|
case 0:
|
|
29
29
|
environment = isAsapEnvironment ? 'asap' : '';
|
|
@@ -40,14 +40,14 @@ var StoryBookAuthProvider = exports.StoryBookAuthProvider = /*#__PURE__*/functio
|
|
|
40
40
|
};
|
|
41
41
|
url = "".concat(_mediaBaseURLS.MEDIA_PLAYGROUND_BASE_URL, "/token/tenant?collection=").concat(collectionName, "&environment=").concat(environment);
|
|
42
42
|
response = fetch(url, config); // We leverage the fact, that our internal /toke/tenant API returns data in the same format as Auth
|
|
43
|
-
_context.next =
|
|
43
|
+
_context.next = 1;
|
|
44
44
|
return response;
|
|
45
|
-
case
|
|
46
|
-
_context.next =
|
|
45
|
+
case 1:
|
|
46
|
+
_context.next = 2;
|
|
47
47
|
return _context.sent.json();
|
|
48
|
-
case
|
|
48
|
+
case 2:
|
|
49
49
|
return _context.abrupt("return", _context.sent);
|
|
50
|
-
case
|
|
50
|
+
case 3:
|
|
51
51
|
case "end":
|
|
52
52
|
return _context.stop();
|
|
53
53
|
}
|
package/dist/cjs/await-error.js
CHANGED
|
@@ -12,28 +12,29 @@ function awaitError(_x, _x2) {
|
|
|
12
12
|
}
|
|
13
13
|
function _awaitError() {
|
|
14
14
|
_awaitError = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(response, expectedMessage) {
|
|
15
|
-
|
|
15
|
+
var _t;
|
|
16
|
+
return _regenerator.default.wrap(function (_context) {
|
|
16
17
|
while (1) switch (_context.prev = _context.next) {
|
|
17
18
|
case 0:
|
|
18
19
|
_context.prev = 0;
|
|
19
|
-
_context.next =
|
|
20
|
+
_context.next = 1;
|
|
20
21
|
return response;
|
|
21
|
-
case
|
|
22
|
-
_context.next =
|
|
22
|
+
case 1:
|
|
23
|
+
_context.next = 3;
|
|
23
24
|
break;
|
|
24
|
-
case
|
|
25
|
-
_context.prev =
|
|
26
|
-
|
|
27
|
-
if (!(
|
|
28
|
-
_context.next =
|
|
25
|
+
case 2:
|
|
26
|
+
_context.prev = 2;
|
|
27
|
+
_t = _context["catch"](0);
|
|
28
|
+
if (!(_t instanceof Error && _t.message !== expectedMessage)) {
|
|
29
|
+
_context.next = 3;
|
|
29
30
|
break;
|
|
30
31
|
}
|
|
31
|
-
throw
|
|
32
|
-
case
|
|
32
|
+
throw _t;
|
|
33
|
+
case 3:
|
|
33
34
|
case "end":
|
|
34
35
|
return _context.stop();
|
|
35
36
|
}
|
|
36
|
-
}, _callee, null, [[0,
|
|
37
|
+
}, _callee, null, [[0, 2]]);
|
|
37
38
|
}));
|
|
38
39
|
return _awaitError.apply(this, arguments);
|
|
39
40
|
}
|
|
@@ -39,21 +39,21 @@ var MediaClientMock = exports.MediaClientMock = /*#__PURE__*/function (_MediaCli
|
|
|
39
39
|
});
|
|
40
40
|
(0, _defineProperty2.default)(_this, "getImage", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
41
41
|
var _this$options$getImag, getImageDelay;
|
|
42
|
-
return _regenerator.default.wrap(function
|
|
42
|
+
return _regenerator.default.wrap(function (_context) {
|
|
43
43
|
while (1) switch (_context.prev = _context.next) {
|
|
44
44
|
case 0:
|
|
45
45
|
_this$options$getImag = _this.options.getImageDelay, getImageDelay = _this$options$getImag === void 0 ? 0 : _this$options$getImag;
|
|
46
46
|
if (_this.hasPreview) {
|
|
47
|
-
_context.next =
|
|
47
|
+
_context.next = 1;
|
|
48
48
|
break;
|
|
49
49
|
}
|
|
50
50
|
throw new Error('some error');
|
|
51
|
-
case
|
|
52
|
-
_context.next =
|
|
51
|
+
case 1:
|
|
52
|
+
_context.next = 2;
|
|
53
53
|
return (0, _nextTick.sleep)(getImageDelay);
|
|
54
|
-
case
|
|
54
|
+
case 2:
|
|
55
55
|
return _context.abrupt("return", (0, _mockData.dataURItoBlob)(_images.tallImage));
|
|
56
|
-
case
|
|
56
|
+
case 3:
|
|
57
57
|
case "end":
|
|
58
58
|
return _context.stop();
|
|
59
59
|
}
|
|
@@ -76,7 +76,7 @@ var MediaClientMock = exports.MediaClientMock = /*#__PURE__*/function (_MediaCli
|
|
|
76
76
|
var mockConfig = {
|
|
77
77
|
authProvider: function () {
|
|
78
78
|
var _authProvider = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
|
|
79
|
-
return _regenerator.default.wrap(function
|
|
79
|
+
return _regenerator.default.wrap(function (_context2) {
|
|
80
80
|
while (1) switch (_context2.prev = _context2.next) {
|
|
81
81
|
case 0:
|
|
82
82
|
return _context2.abrupt("return", {
|
|
@@ -18,16 +18,16 @@ var simulateProcessed = exports.simulateProcessed = function simulateProcessed()
|
|
|
18
18
|
return {
|
|
19
19
|
simulation: function () {
|
|
20
20
|
var _simulation = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(factory) {
|
|
21
|
-
return _regenerator.default.wrap(function
|
|
21
|
+
return _regenerator.default.wrap(function (_context) {
|
|
22
22
|
while (1) switch (_context.prev = _context.next) {
|
|
23
23
|
case 0:
|
|
24
|
-
_context.next =
|
|
24
|
+
_context.next = 1;
|
|
25
25
|
return (0, _nextTick.sleep)(speed);
|
|
26
|
-
case
|
|
26
|
+
case 1:
|
|
27
27
|
factory.next('processed', {
|
|
28
28
|
withRemotePreview: withRemotePreview
|
|
29
29
|
});
|
|
30
|
-
case
|
|
30
|
+
case 2:
|
|
31
31
|
case "end":
|
|
32
32
|
return _context.stop();
|
|
33
33
|
}
|
|
@@ -48,20 +48,20 @@ var simulateProcessing = exports.simulateProcessing = function simulateProcessin
|
|
|
48
48
|
description: "File is processing, then ".concat(suceeded ? 'succeeds' : 'fails', " ").concat(withRemotePreview ? 'with' : 'without', " remote preview"),
|
|
49
49
|
simulation: function () {
|
|
50
50
|
var _simulation2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(factory) {
|
|
51
|
-
return _regenerator.default.wrap(function
|
|
51
|
+
return _regenerator.default.wrap(function (_context2) {
|
|
52
52
|
while (1) switch (_context2.prev = _context2.next) {
|
|
53
53
|
case 0:
|
|
54
|
-
_context2.next =
|
|
54
|
+
_context2.next = 1;
|
|
55
55
|
return (0, _nextTick.sleep)(speed);
|
|
56
|
-
case
|
|
56
|
+
case 1:
|
|
57
57
|
factory.next('processing');
|
|
58
|
-
_context2.next =
|
|
58
|
+
_context2.next = 2;
|
|
59
59
|
return (0, _nextTick.sleep)(speed);
|
|
60
|
-
case
|
|
60
|
+
case 2:
|
|
61
61
|
factory.next('processing');
|
|
62
|
-
_context2.next =
|
|
62
|
+
_context2.next = 3;
|
|
63
63
|
return (0, _nextTick.sleep)(speed * 0.5);
|
|
64
|
-
case
|
|
64
|
+
case 3:
|
|
65
65
|
if (!suceeded) {
|
|
66
66
|
factory.next('failed-processing', {
|
|
67
67
|
withRemotePreview: withRemotePreview
|
|
@@ -71,7 +71,7 @@ var simulateProcessing = exports.simulateProcessing = function simulateProcessin
|
|
|
71
71
|
withRemotePreview: withRemotePreview
|
|
72
72
|
});
|
|
73
73
|
}
|
|
74
|
-
case
|
|
74
|
+
case 4:
|
|
75
75
|
case "end":
|
|
76
76
|
return _context2.stop();
|
|
77
77
|
}
|
|
@@ -89,14 +89,14 @@ var simulateImmediateFailProcessing = exports.simulateImmediateFailProcessing =
|
|
|
89
89
|
description: 'The first sate is failed-processing with no preview',
|
|
90
90
|
simulation: function () {
|
|
91
91
|
var _simulation3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(factory) {
|
|
92
|
-
return _regenerator.default.wrap(function
|
|
92
|
+
return _regenerator.default.wrap(function (_context3) {
|
|
93
93
|
while (1) switch (_context3.prev = _context3.next) {
|
|
94
94
|
case 0:
|
|
95
|
-
_context3.next =
|
|
95
|
+
_context3.next = 1;
|
|
96
96
|
return (0, _nextTick.sleep)(speed);
|
|
97
|
-
case
|
|
97
|
+
case 1:
|
|
98
98
|
factory.next('failed-processing');
|
|
99
|
-
case
|
|
99
|
+
case 2:
|
|
100
100
|
case "end":
|
|
101
101
|
return _context3.stop();
|
|
102
102
|
}
|
|
@@ -116,49 +116,49 @@ var simulateUpload = exports.simulateUpload = function simulateUpload(withLocalP
|
|
|
116
116
|
simulation: function () {
|
|
117
117
|
var _simulation4 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4(factory) {
|
|
118
118
|
var chunks, chunkUploadDelay, processingTime, uploadUpTo, index;
|
|
119
|
-
return _regenerator.default.wrap(function
|
|
119
|
+
return _regenerator.default.wrap(function (_context4) {
|
|
120
120
|
while (1) switch (_context4.prev = _context4.next) {
|
|
121
121
|
case 0:
|
|
122
122
|
chunks = 3;
|
|
123
123
|
chunkUploadDelay = 500;
|
|
124
124
|
processingTime = speed;
|
|
125
|
-
_context4.next =
|
|
125
|
+
_context4.next = 1;
|
|
126
126
|
return (0, _nextTick.sleep)(speed);
|
|
127
|
-
case
|
|
127
|
+
case 1:
|
|
128
128
|
factory.next('uploading', {
|
|
129
129
|
withLocalPreview: withLocalPreview
|
|
130
130
|
});
|
|
131
131
|
uploadUpTo = !suceeded ? chunks / 2 : chunks;
|
|
132
132
|
index = 0;
|
|
133
|
-
case
|
|
133
|
+
case 2:
|
|
134
134
|
if (!(index <= uploadUpTo)) {
|
|
135
|
-
_context4.next =
|
|
135
|
+
_context4.next = 4;
|
|
136
136
|
break;
|
|
137
137
|
}
|
|
138
138
|
factory.next('uploading', {
|
|
139
139
|
uploadProgress: index / chunks,
|
|
140
140
|
withLocalPreview: withLocalPreview
|
|
141
141
|
});
|
|
142
|
-
_context4.next =
|
|
142
|
+
_context4.next = 3;
|
|
143
143
|
return (0, _nextTick.sleep)(chunkUploadDelay);
|
|
144
|
-
case
|
|
144
|
+
case 3:
|
|
145
145
|
index++;
|
|
146
|
-
_context4.next =
|
|
146
|
+
_context4.next = 2;
|
|
147
147
|
break;
|
|
148
|
-
case
|
|
148
|
+
case 4:
|
|
149
149
|
if (!suceeded) {
|
|
150
150
|
factory.error(new Error('some-error'));
|
|
151
151
|
}
|
|
152
152
|
factory.next('processing', {
|
|
153
153
|
withLocalPreview: withLocalPreview
|
|
154
154
|
});
|
|
155
|
-
_context4.next =
|
|
155
|
+
_context4.next = 5;
|
|
156
156
|
return (0, _nextTick.sleep)(processingTime);
|
|
157
|
-
case
|
|
157
|
+
case 5:
|
|
158
158
|
factory.next('processed', {
|
|
159
159
|
withLocalPreview: withLocalPreview
|
|
160
160
|
});
|
|
161
|
-
case
|
|
161
|
+
case 6:
|
|
162
162
|
case "end":
|
|
163
163
|
return _context4.stop();
|
|
164
164
|
}
|
|
@@ -176,14 +176,14 @@ var simulateErrorState = exports.simulateErrorState = function simulateErrorStat
|
|
|
176
176
|
description: 'File state is error',
|
|
177
177
|
simulation: function () {
|
|
178
178
|
var _simulation5 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5(factory) {
|
|
179
|
-
return _regenerator.default.wrap(function
|
|
179
|
+
return _regenerator.default.wrap(function (_context5) {
|
|
180
180
|
while (1) switch (_context5.prev = _context5.next) {
|
|
181
181
|
case 0:
|
|
182
|
-
_context5.next =
|
|
182
|
+
_context5.next = 1;
|
|
183
183
|
return (0, _nextTick.sleep)(speed);
|
|
184
|
-
case
|
|
184
|
+
case 1:
|
|
185
185
|
factory.next('error');
|
|
186
|
-
case
|
|
186
|
+
case 2:
|
|
187
187
|
case "end":
|
|
188
188
|
return _context5.stop();
|
|
189
189
|
}
|
|
@@ -201,14 +201,14 @@ var simulateError = exports.simulateError = function simulateError() {
|
|
|
201
201
|
description: 'Subscription throws an error through the observer',
|
|
202
202
|
simulation: function () {
|
|
203
203
|
var _simulation6 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6(factory) {
|
|
204
|
-
return _regenerator.default.wrap(function
|
|
204
|
+
return _regenerator.default.wrap(function (_context6) {
|
|
205
205
|
while (1) switch (_context6.prev = _context6.next) {
|
|
206
206
|
case 0:
|
|
207
|
-
_context6.next =
|
|
207
|
+
_context6.next = 1;
|
|
208
208
|
return (0, _nextTick.sleep)(speed);
|
|
209
|
-
case
|
|
209
|
+
case 1:
|
|
210
210
|
factory.error(new Error('error thrown from client'));
|
|
211
|
-
case
|
|
211
|
+
case 2:
|
|
212
212
|
case "end":
|
|
213
213
|
return _context6.stop();
|
|
214
214
|
}
|
|
@@ -232,28 +232,28 @@ var simulateManyProcessed = exports.simulateManyProcessed = function simulateMan
|
|
|
232
232
|
description: '',
|
|
233
233
|
simulation: function () {
|
|
234
234
|
var _simulation7 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee7(factory) {
|
|
235
|
-
return _regenerator.default.wrap(function
|
|
235
|
+
return _regenerator.default.wrap(function (_context7) {
|
|
236
236
|
while (1) switch (_context7.prev = _context7.next) {
|
|
237
237
|
case 0:
|
|
238
|
-
_context7.next =
|
|
238
|
+
_context7.next = 1;
|
|
239
239
|
return (0, _nextTick.sleep)(speed);
|
|
240
|
-
case
|
|
240
|
+
case 1:
|
|
241
241
|
factory.next('processed', {
|
|
242
242
|
withRemotePreview: withRemotePreview
|
|
243
243
|
});
|
|
244
|
-
_context7.next =
|
|
244
|
+
_context7.next = 2;
|
|
245
245
|
return (0, _nextTick.sleep)(speed);
|
|
246
|
-
case
|
|
246
|
+
case 2:
|
|
247
247
|
factory.next('processed', {
|
|
248
248
|
withRemotePreview: withRemotePreview
|
|
249
249
|
});
|
|
250
|
-
_context7.next =
|
|
250
|
+
_context7.next = 3;
|
|
251
251
|
return (0, _nextTick.sleep)(speed);
|
|
252
|
-
case
|
|
252
|
+
case 3:
|
|
253
253
|
factory.next('processed', {
|
|
254
254
|
withRemotePreview: withRemotePreview
|
|
255
255
|
});
|
|
256
|
-
case
|
|
256
|
+
case 4:
|
|
257
257
|
case "end":
|
|
258
258
|
return _context7.stop();
|
|
259
259
|
}
|
|
@@ -272,19 +272,19 @@ var simulateEmptyDetails = exports.simulateEmptyDetails = function simulateEmpty
|
|
|
272
272
|
simulation: function () {
|
|
273
273
|
var _simulation8 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee8(factory) {
|
|
274
274
|
var emptyDetails;
|
|
275
|
-
return _regenerator.default.wrap(function
|
|
275
|
+
return _regenerator.default.wrap(function (_context8) {
|
|
276
276
|
while (1) switch (_context8.prev = _context8.next) {
|
|
277
277
|
case 0:
|
|
278
278
|
emptyDetails = {
|
|
279
279
|
createdAt: 1630986510989
|
|
280
280
|
};
|
|
281
|
-
_context8.next =
|
|
281
|
+
_context8.next = 1;
|
|
282
282
|
return (0, _nextTick.sleep)(speed);
|
|
283
|
-
case
|
|
283
|
+
case 1:
|
|
284
284
|
factory.next('processing', {
|
|
285
285
|
fileDetails: emptyDetails
|
|
286
286
|
});
|
|
287
|
-
case
|
|
287
|
+
case 2:
|
|
288
288
|
case "end":
|
|
289
289
|
return _context8.stop();
|
|
290
290
|
}
|
|
@@ -303,27 +303,27 @@ var simulateUpdateFileId = exports.simulateUpdateFileId = function simulateUpdat
|
|
|
303
303
|
simulation: function () {
|
|
304
304
|
var _simulation9 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee9(factory, _ref) {
|
|
305
305
|
var updateIdentifier;
|
|
306
|
-
return _regenerator.default.wrap(function
|
|
306
|
+
return _regenerator.default.wrap(function (_context9) {
|
|
307
307
|
while (1) switch (_context9.prev = _context9.next) {
|
|
308
308
|
case 0:
|
|
309
309
|
updateIdentifier = _ref.updateIdentifier;
|
|
310
|
-
_context9.next =
|
|
310
|
+
_context9.next = 1;
|
|
311
311
|
return (0, _nextTick.sleep)(speed);
|
|
312
|
-
case
|
|
312
|
+
case 1:
|
|
313
313
|
factory.next('failed-processing');
|
|
314
|
-
_context9.next =
|
|
314
|
+
_context9.next = 2;
|
|
315
315
|
return (0, _nextTick.sleep)(speed);
|
|
316
|
-
case
|
|
316
|
+
case 2:
|
|
317
317
|
updateIdentifier('doc');
|
|
318
|
-
_context9.next =
|
|
318
|
+
_context9.next = 3;
|
|
319
319
|
return (0, _nextTick.sleep)(speed);
|
|
320
|
-
case
|
|
320
|
+
case 3:
|
|
321
321
|
factory.next('processing');
|
|
322
|
-
_context9.next =
|
|
322
|
+
_context9.next = 4;
|
|
323
323
|
return (0, _nextTick.sleep)(speed);
|
|
324
|
-
case
|
|
324
|
+
case 4:
|
|
325
325
|
factory.next('processed');
|
|
326
|
-
case
|
|
326
|
+
case 5:
|
|
327
327
|
case "end":
|
|
328
328
|
return _context9.stop();
|
|
329
329
|
}
|
|
@@ -341,7 +341,7 @@ var simulateAlwaysLoading = exports.simulateAlwaysLoading = function simulateAlw
|
|
|
341
341
|
description: 'File state never fetched',
|
|
342
342
|
simulation: function () {
|
|
343
343
|
var _simulation0 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee0() {
|
|
344
|
-
return _regenerator.default.wrap(function
|
|
344
|
+
return _regenerator.default.wrap(function (_context0) {
|
|
345
345
|
while (1) switch (_context0.prev = _context0.next) {
|
|
346
346
|
case 0:
|
|
347
347
|
case "end":
|
|
@@ -361,20 +361,20 @@ var simulateAlwaysProcessing = exports.simulateAlwaysProcessing = function simul
|
|
|
361
361
|
description: 'File state is permanently processing',
|
|
362
362
|
simulation: function () {
|
|
363
363
|
var _simulation1 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee1(factory) {
|
|
364
|
-
return _regenerator.default.wrap(function
|
|
364
|
+
return _regenerator.default.wrap(function (_context1) {
|
|
365
365
|
while (1) switch (_context1.prev = _context1.next) {
|
|
366
366
|
case 0:
|
|
367
|
-
_context1.next =
|
|
367
|
+
_context1.next = 1;
|
|
368
368
|
return (0, _nextTick.sleep)(speed);
|
|
369
|
-
case
|
|
369
|
+
case 1:
|
|
370
370
|
factory.next('processing');
|
|
371
|
-
_context1.next =
|
|
371
|
+
_context1.next = 2;
|
|
372
372
|
return (0, _nextTick.sleep)(speed);
|
|
373
|
-
case
|
|
373
|
+
case 2:
|
|
374
374
|
factory.next('processing');
|
|
375
|
-
_context1.next =
|
|
375
|
+
_context1.next = 3;
|
|
376
376
|
return (0, _nextTick.sleep)(speed * 0.5);
|
|
377
|
-
case
|
|
377
|
+
case 3:
|
|
378
378
|
case "end":
|
|
379
379
|
return _context1.stop();
|
|
380
380
|
}
|