@atlaskit/media-test-helpers 28.7.5 → 29.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 +75 -0
- package/dist/cjs/I18nWrapper.js +3 -17
- package/dist/cjs/MockGlobalImage.js +1 -1
- package/dist/cjs/authProvider.js +1 -2
- package/dist/cjs/clipboardEventMocks.js +1 -1
- package/dist/cjs/collectionNames.js +1 -1
- package/dist/cjs/exampleMediaItems.js +1 -1
- package/dist/cjs/fakeI18n.js +5 -1
- package/dist/cjs/fakeMediaClient.js +2 -1
- package/dist/cjs/featureFlagsWrapper/helpers.js +1 -1
- package/dist/cjs/fileReader.js +1 -1
- package/dist/cjs/getAuthFromContextProvider.js +2 -3
- package/dist/cjs/images.js +7 -7
- package/dist/cjs/index.js +272 -260
- package/dist/cjs/jestHelpers.js +1 -1
- package/dist/cjs/mediaClientErrors.js +1 -1
- package/dist/cjs/mediaClientProvider.js +1 -1
- package/dist/cjs/mediaPickerAuthProvider.js +3 -4
- package/dist/cjs/mediaPickerMocks.js +1 -1
- package/dist/cjs/mockData/handlers/tenantAuth.js +2 -2
- package/dist/cjs/mockData/index.js +19 -19
- package/dist/cjs/mockData/matchers.js +1 -1
- package/dist/cjs/mocks/database/collection-item.js +1 -1
- package/dist/cjs/mocks/database/index.js +2 -2
- package/dist/cjs/mocks/fileAndDirectoriesUtils.js +1 -1
- package/dist/cjs/mocks/media-mock.js +2 -1
- package/dist/cjs/mocks/routers/media-playground-router.js +3 -3
- package/dist/cjs/mocks/websockets/messages.js +1 -1
- package/dist/cjs/mountWithIntlContext.js +62 -15
- package/dist/cjs/userAuthProvider.js +3 -4
- package/dist/cjs/utils/index.js +1 -1
- package/dist/cjs/utils/logging.js +1 -1
- package/dist/cjs/utils/mockData.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/cjs/waitUntil.js +1 -1
- package/dist/es2019/I18nWrapper.js +3 -16
- package/dist/es2019/authProvider.js +1 -2
- package/dist/es2019/fakeI18n.js +4 -2
- package/dist/es2019/fakeMediaClient.js +1 -0
- package/dist/es2019/getAuthFromContextProvider.js +2 -3
- package/dist/es2019/index.js +1 -1
- package/dist/es2019/mediaPickerAuthProvider.js +2 -3
- package/dist/es2019/mockData/handlers/tenantAuth.js +2 -2
- package/dist/es2019/mocks/routers/media-playground-router.js +3 -3
- package/dist/es2019/mountWithIntlContext.js +46 -13
- package/dist/es2019/userAuthProvider.js +2 -3
- package/dist/es2019/version.json +1 -1
- package/dist/esm/I18nWrapper.js +3 -18
- package/dist/esm/authProvider.js +1 -2
- package/dist/esm/fakeI18n.js +5 -1
- package/dist/esm/fakeMediaClient.js +1 -0
- package/dist/esm/getAuthFromContextProvider.js +2 -3
- package/dist/esm/index.js +1 -1
- package/dist/esm/mediaPickerAuthProvider.js +2 -3
- package/dist/esm/mockData/handlers/tenantAuth.js +2 -2
- package/dist/esm/mocks/routers/media-playground-router.js +3 -3
- package/dist/esm/mountWithIntlContext.js +54 -14
- package/dist/esm/userAuthProvider.js +2 -3
- package/dist/esm/version.json +1 -1
- package/dist/types/featureFlagsWrapper/dropdown.d.ts +1 -0
- package/dist/types/featureFlagsWrapper/helpers.d.ts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/mountWithIntlContext.d.ts +12 -3
- package/package.json +8 -8
|
@@ -1,25 +1,58 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { RawIntlProvider, createIntl, IntlProvider } from 'react-intl-next';
|
|
3
|
+
import { mount, shallow } from 'enzyme';
|
|
4
|
+
const mockIntl = createIntl({
|
|
5
|
+
locale: 'en'
|
|
6
|
+
});
|
|
7
|
+
/**
|
|
8
|
+
* When using React-Intl `injectIntl` on components, props.intl is required.
|
|
9
|
+
*/
|
|
3
10
|
|
|
11
|
+
function nodeWithIntlProp(node) {
|
|
12
|
+
const intl = !!node.props.intl ? node.props.intl : mockIntl;
|
|
13
|
+
return /*#__PURE__*/React.createElement(RawIntlProvider, {
|
|
14
|
+
value: intl
|
|
15
|
+
}, /*#__PURE__*/React.cloneElement(node, {
|
|
16
|
+
intl
|
|
17
|
+
}));
|
|
18
|
+
}
|
|
4
19
|
/* TODO: We are explicitly using the third arg of ReactWrapper to work around the following TS issue which prevents a d.ts from being generated
|
|
5
20
|
* and therefore fails the build:
|
|
6
21
|
* error TS2742: The inferred type of 'mountWithIntlContext' cannot be named without a reference to 'react-transition-group/node_modules/@types/react'. This is likely not portable. A type annotation is necessary.
|
|
7
22
|
* TS is resolving enzyme's usage of react to react-transition-group???
|
|
8
23
|
*/
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
export const mountWithIntlContext = (node, {
|
|
27
|
+
context = {},
|
|
28
|
+
childContextTypes = {},
|
|
29
|
+
...additionalOptions
|
|
30
|
+
} = {}) => {
|
|
31
|
+
const intl = !!node.props.intl ? node.props.intl : mockIntl;
|
|
32
|
+
return mount(nodeWithIntlProp(node), {
|
|
33
|
+
context: {
|
|
34
|
+
intl,
|
|
35
|
+
...context
|
|
36
|
+
},
|
|
37
|
+
...additionalOptions
|
|
13
38
|
});
|
|
14
|
-
|
|
15
|
-
|
|
39
|
+
};
|
|
40
|
+
export const shallowWithIntlContext = (node, {
|
|
41
|
+
context = {},
|
|
42
|
+
...additionalOptions
|
|
43
|
+
} = {}) => {
|
|
44
|
+
const intl = !!node.props.intl ? node.props.intl : mockIntl;
|
|
45
|
+
return shallow(nodeWithIntlProp(node), {
|
|
16
46
|
context: {
|
|
17
47
|
intl,
|
|
18
|
-
...
|
|
48
|
+
...context
|
|
19
49
|
},
|
|
20
|
-
|
|
21
|
-
intl: intlShape,
|
|
22
|
-
...childContextTypes
|
|
23
|
-
}
|
|
50
|
+
...additionalOptions
|
|
24
51
|
});
|
|
52
|
+
};
|
|
53
|
+
export const mountWithIntlWrapper = node => {
|
|
54
|
+
return mount( /*#__PURE__*/React.createElement(props => /*#__PURE__*/React.createElement(IntlProvider, {
|
|
55
|
+
locale: "en"
|
|
56
|
+
}, /*#__PURE__*/React.cloneElement(node, { ...props
|
|
57
|
+
}))));
|
|
25
58
|
};
|
|
@@ -15,10 +15,9 @@ export const userAuthProvider = () => {
|
|
|
15
15
|
return userAuthProviderPromiseCache;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
const url = 'https://
|
|
18
|
+
const url = 'https://media-playground.dev.atl-paas.net/api/token/user/impersonation';
|
|
19
19
|
userAuthProviderPromiseCache = fetch(url, {
|
|
20
|
-
method: 'GET'
|
|
21
|
-
credentials: 'include'
|
|
20
|
+
method: 'GET'
|
|
22
21
|
}).then(response => // We leverage the fact, that our internal /toke/tenant API returns data in the same format as Auth
|
|
23
22
|
response.json());
|
|
24
23
|
return userAuthProviderPromiseCache;
|
package/dist/es2019/version.json
CHANGED
package/dist/esm/I18nWrapper.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
2
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
3
|
-
import React, { useState
|
|
4
|
-
import { IntlProvider
|
|
3
|
+
import React, { useState } from 'react';
|
|
4
|
+
import { IntlProvider } from 'react-intl-next';
|
|
5
5
|
import LocaleSelect, { defaultLocales } from '@atlaskit/locale/LocaleSelect';
|
|
6
6
|
import { locales } from '@atlaskit/media-ui/locales';
|
|
7
7
|
|
|
@@ -18,17 +18,6 @@ var selectableLocales = defaultLocales.reduce(function (result, locale) {
|
|
|
18
18
|
|
|
19
19
|
return [].concat(_toConsumableArray(result), [locale]);
|
|
20
20
|
}, []);
|
|
21
|
-
|
|
22
|
-
function addAllLocaleData() {
|
|
23
|
-
Object.keys(locales).forEach(function (localeKey) {
|
|
24
|
-
var lang = localeKey.substring(0, 2);
|
|
25
|
-
|
|
26
|
-
var localeData = require("react-intl/locale-data/".concat(lang));
|
|
27
|
-
|
|
28
|
-
addLocaleData(localeData);
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
|
|
32
21
|
export var I18NWrapper = function I18NWrapper(_ref) {
|
|
33
22
|
var children = _ref.children;
|
|
34
23
|
|
|
@@ -38,12 +27,8 @@ export var I18NWrapper = function I18NWrapper(_ref) {
|
|
|
38
27
|
}),
|
|
39
28
|
_useState2 = _slicedToArray(_useState, 2),
|
|
40
29
|
locale = _useState2[0],
|
|
41
|
-
setLocale = _useState2[1];
|
|
42
|
-
|
|
30
|
+
setLocale = _useState2[1];
|
|
43
31
|
|
|
44
|
-
useEffect(function () {
|
|
45
|
-
return addAllLocaleData();
|
|
46
|
-
}, []);
|
|
47
32
|
var lang = locale.value.substring(0, 2);
|
|
48
33
|
var messages = getMessages(locale.value);
|
|
49
34
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
package/dist/esm/authProvider.js
CHANGED
|
@@ -4,7 +4,7 @@ import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
|
4
4
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
5
5
|
import { defaultCollectionName } from './collectionNames';
|
|
6
6
|
var cachedAuths = {};
|
|
7
|
-
var authProviderBaseURL = 'https://
|
|
7
|
+
var authProviderBaseURL = 'https://media-playground.dev.atl-paas.net/';
|
|
8
8
|
export var StoryBookAuthProvider = /*#__PURE__*/function () {
|
|
9
9
|
function StoryBookAuthProvider() {
|
|
10
10
|
_classCallCheck(this, StoryBookAuthProvider);
|
|
@@ -26,7 +26,6 @@ export var StoryBookAuthProvider = /*#__PURE__*/function () {
|
|
|
26
26
|
headers.append('Accept', 'text/plain, */*; q=0.01');
|
|
27
27
|
config = {
|
|
28
28
|
method: 'POST',
|
|
29
|
-
credentials: 'include',
|
|
30
29
|
headers: headers,
|
|
31
30
|
body: access ? JSON.stringify({
|
|
32
31
|
access: access
|
package/dist/esm/fakeI18n.js
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
// fakeIntl["..."] here to indicate those went through formatMessage and not just left as string itself
|
|
1
2
|
export var fakeIntl = {
|
|
2
|
-
formatMessage: function
|
|
3
|
+
formatMessage: jest.fn(function (_ref) {
|
|
4
|
+
var defaultMessage = _ref.defaultMessage;
|
|
5
|
+
return "fakeIntl[\"".concat(defaultMessage, "\"]");
|
|
6
|
+
})
|
|
3
7
|
};
|
|
@@ -41,6 +41,7 @@ export var fakeMediaClient = function fakeMediaClient() {
|
|
|
41
41
|
}
|
|
42
42
|
});
|
|
43
43
|
asMock(mediaClient.getImageUrl).mockResolvedValue('some-image-url');
|
|
44
|
+
asMock(mediaClient.getImageUrlSync).mockReturnValue('some-image-url');
|
|
44
45
|
asMock(mediaClient.getImage).mockImplementation(mockMediaStore.getImage);
|
|
45
46
|
asMock(mediaClient.collection.getItems).mockReturnValue(of([]));
|
|
46
47
|
asMock(mediaClient.file.copyFile).mockReturnValue({
|
|
@@ -17,7 +17,7 @@ export var getAuthFromContextProvider = /*#__PURE__*/function () {
|
|
|
17
17
|
while (1) {
|
|
18
18
|
switch (_context.prev = _context.next) {
|
|
19
19
|
case 0:
|
|
20
|
-
url = 'https://
|
|
20
|
+
url = 'https://media-playground.dev.atl-paas.net/token/tenant?environment=asap';
|
|
21
21
|
body = JSON.stringify({
|
|
22
22
|
access: access
|
|
23
23
|
});
|
|
@@ -28,8 +28,7 @@ export var getAuthFromContextProvider = /*#__PURE__*/function () {
|
|
|
28
28
|
return fetch(url, {
|
|
29
29
|
method: 'POST',
|
|
30
30
|
body: body,
|
|
31
|
-
headers: headers
|
|
32
|
-
credentials: 'include'
|
|
31
|
+
headers: headers
|
|
33
32
|
});
|
|
34
33
|
|
|
35
34
|
case 7:
|
package/dist/esm/index.js
CHANGED
|
@@ -21,7 +21,7 @@ export { nextTick, sleep } from './nextTick';
|
|
|
21
21
|
export { timeoutPromise } from './timeoutPromise';
|
|
22
22
|
export { asMock, asMockFunction, asMockReturnValue, asMockFunctionReturnValue, asMockFunctionResolvedValue, expectConstructorToHaveBeenCalledWith, expectFunctionToHaveBeenCalledWith, expectToEqual } from './jestHelpers';
|
|
23
23
|
export { I18NWrapper } from './I18nWrapper';
|
|
24
|
-
export { mountWithIntlContext } from './mountWithIntlContext';
|
|
24
|
+
export { mountWithIntlContext, mountWithIntlWrapper, shallowWithIntlContext } from './mountWithIntlContext';
|
|
25
25
|
export { fakeIntl } from './fakeI18n';
|
|
26
26
|
export { mockCanvas } from './mockCanvas';
|
|
27
27
|
export { default as KeyboardEventWithKeyCode } from './keyboardEventWithKeyCode';
|
|
@@ -30,7 +30,7 @@ var requestAuthProvider = /*#__PURE__*/function () {
|
|
|
30
30
|
while (1) {
|
|
31
31
|
switch (_context.prev = _context.next) {
|
|
32
32
|
case 0:
|
|
33
|
-
url = "https://
|
|
33
|
+
url = "https://media-playground.dev.atl-paas.net/token/tenant?environment=".concat(authEnvironment);
|
|
34
34
|
body = JSON.stringify({
|
|
35
35
|
access: accessUrns[collectionName] || {}
|
|
36
36
|
});
|
|
@@ -41,8 +41,7 @@ var requestAuthProvider = /*#__PURE__*/function () {
|
|
|
41
41
|
return fetch(url, {
|
|
42
42
|
method: 'POST',
|
|
43
43
|
body: body,
|
|
44
|
-
headers: headers
|
|
45
|
-
credentials: 'include'
|
|
44
|
+
headers: headers
|
|
46
45
|
});
|
|
47
46
|
|
|
48
47
|
case 7:
|
|
@@ -13,7 +13,7 @@ export var tenantAuth = function tenantAuth(context) {
|
|
|
13
13
|
var data1 = {
|
|
14
14
|
method: 'POST',
|
|
15
15
|
url: {
|
|
16
|
-
path: '/
|
|
16
|
+
path: '/token/tenant',
|
|
17
17
|
query: {
|
|
18
18
|
collection: context().tenantContext.collectionName,
|
|
19
19
|
environment: ''
|
|
@@ -28,7 +28,7 @@ export var tenantAuth = function tenantAuth(context) {
|
|
|
28
28
|
var data2 = {
|
|
29
29
|
method: 'GET',
|
|
30
30
|
url: {
|
|
31
|
-
path: '/
|
|
31
|
+
path: '/token/tenant',
|
|
32
32
|
query: {
|
|
33
33
|
collection: context().tenantContext.collectionName,
|
|
34
34
|
environment: ''
|
|
@@ -2,12 +2,12 @@ import { Router } from 'kakapo';
|
|
|
2
2
|
import { userAuthProvider, tenantAuthProvider } from '../database';
|
|
3
3
|
export function createMediaPlaygroundRouter() {
|
|
4
4
|
var router = new Router({
|
|
5
|
-
host: 'https://
|
|
5
|
+
host: 'https://media-playground.dev.atl-paas.net',
|
|
6
6
|
requestDelay: 10
|
|
7
7
|
}, {
|
|
8
8
|
strategies: ['fetch']
|
|
9
9
|
});
|
|
10
|
-
router.get('/
|
|
11
|
-
router.post('/
|
|
10
|
+
router.get('/api/token/user/impersonation', userAuthProvider);
|
|
11
|
+
router.post('/token/tenant', tenantAuthProvider);
|
|
12
12
|
return router;
|
|
13
13
|
}
|
|
@@ -1,29 +1,69 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
2
3
|
|
|
3
4
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
4
5
|
|
|
5
6
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
6
7
|
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
8
|
+
import React from 'react';
|
|
9
|
+
import { RawIntlProvider, createIntl, IntlProvider } from 'react-intl-next';
|
|
10
|
+
import { mount, shallow } from 'enzyme';
|
|
11
|
+
var mockIntl = createIntl({
|
|
12
|
+
locale: 'en'
|
|
13
|
+
});
|
|
14
|
+
/**
|
|
15
|
+
* When using React-Intl `injectIntl` on components, props.intl is required.
|
|
16
|
+
*/
|
|
9
17
|
|
|
18
|
+
function nodeWithIntlProp(node) {
|
|
19
|
+
var intl = !!node.props.intl ? node.props.intl : mockIntl;
|
|
20
|
+
return /*#__PURE__*/React.createElement(RawIntlProvider, {
|
|
21
|
+
value: intl
|
|
22
|
+
}, /*#__PURE__*/React.cloneElement(node, {
|
|
23
|
+
intl: intl
|
|
24
|
+
}));
|
|
25
|
+
}
|
|
10
26
|
/* TODO: We are explicitly using the third arg of ReactWrapper to work around the following TS issue which prevents a d.ts from being generated
|
|
11
27
|
* and therefore fails the build:
|
|
12
28
|
* error TS2742: The inferred type of 'mountWithIntlContext' cannot be named without a reference to 'react-transition-group/node_modules/@types/react'. This is likely not portable. A type annotation is necessary.
|
|
13
29
|
* TS is resolving enzyme's usage of react to react-transition-group???
|
|
14
30
|
*/
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
var
|
|
21
|
-
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
export var mountWithIntlContext = function mountWithIntlContext(node) {
|
|
34
|
+
var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
35
|
+
|
|
36
|
+
var _ref$context = _ref.context,
|
|
37
|
+
context = _ref$context === void 0 ? {} : _ref$context,
|
|
38
|
+
_ref$childContextType = _ref.childContextTypes,
|
|
39
|
+
childContextTypes = _ref$childContextType === void 0 ? {} : _ref$childContextType,
|
|
40
|
+
additionalOptions = _objectWithoutProperties(_ref, ["context", "childContextTypes"]);
|
|
41
|
+
|
|
42
|
+
var intl = !!node.props.intl ? node.props.intl : mockIntl;
|
|
43
|
+
return mount(nodeWithIntlProp(node), _objectSpread({
|
|
44
|
+
context: _objectSpread({
|
|
45
|
+
intl: intl
|
|
46
|
+
}, context)
|
|
47
|
+
}, additionalOptions));
|
|
48
|
+
};
|
|
49
|
+
export var shallowWithIntlContext = function shallowWithIntlContext(node) {
|
|
50
|
+
var _ref2 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
51
|
+
|
|
52
|
+
var _ref2$context = _ref2.context,
|
|
53
|
+
context = _ref2$context === void 0 ? {} : _ref2$context,
|
|
54
|
+
additionalOptions = _objectWithoutProperties(_ref2, ["context"]);
|
|
55
|
+
|
|
56
|
+
var intl = !!node.props.intl ? node.props.intl : mockIntl;
|
|
57
|
+
return shallow(nodeWithIntlProp(node), _objectSpread({
|
|
22
58
|
context: _objectSpread({
|
|
23
59
|
intl: intl
|
|
24
|
-
},
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
60
|
+
}, context)
|
|
61
|
+
}, additionalOptions));
|
|
62
|
+
};
|
|
63
|
+
export var mountWithIntlWrapper = function mountWithIntlWrapper(node) {
|
|
64
|
+
return mount( /*#__PURE__*/React.createElement(function (props) {
|
|
65
|
+
return /*#__PURE__*/React.createElement(IntlProvider, {
|
|
66
|
+
locale: "en"
|
|
67
|
+
}, /*#__PURE__*/React.cloneElement(node, _objectSpread({}, props)));
|
|
68
|
+
}));
|
|
29
69
|
};
|
|
@@ -15,10 +15,9 @@ export var userAuthProvider = function userAuthProvider() {
|
|
|
15
15
|
return userAuthProviderPromiseCache;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
var url = 'https://
|
|
18
|
+
var url = 'https://media-playground.dev.atl-paas.net/api/token/user/impersonation';
|
|
19
19
|
userAuthProviderPromiseCache = fetch(url, {
|
|
20
|
-
method: 'GET'
|
|
21
|
-
credentials: 'include'
|
|
20
|
+
method: 'GET'
|
|
22
21
|
}).then(function (response) {
|
|
23
22
|
return (// We leverage the fact, that our internal /toke/tenant API returns data in the same format as Auth
|
|
24
23
|
response.json()
|
package/dist/esm/version.json
CHANGED
|
@@ -2,4 +2,4 @@ import { MediaFeatureFlags } from '@atlaskit/media-common';
|
|
|
2
2
|
export declare const setLocalFeatureFlag: (key: keyof MediaFeatureFlags, value: number | boolean | string | Object) => void;
|
|
3
3
|
export declare const clearLocalFeatureFlag: (key: keyof MediaFeatureFlags) => void;
|
|
4
4
|
export declare const clearAllLocalFeatureFlags: () => void;
|
|
5
|
-
export declare const getMediaFeatureFlags: (filter?: ("newCardExperience" | "
|
|
5
|
+
export declare const getMediaFeatureFlags: (filter?: ("newCardExperience" | "captions" | "mediaInline" | "folderUploads")[] | undefined) => MediaFeatureFlags;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -27,7 +27,7 @@ export { asMock, asMockFunction, asMockReturnValue, asMockFunctionReturnValue, a
|
|
|
27
27
|
export type { ExpectConstructorToHaveBeenCalledWith, ExpectFunctionToHaveBeenCalledWith, JestSpy, JestFunction, } from './jestHelpers';
|
|
28
28
|
export { I18NWrapper } from './I18nWrapper';
|
|
29
29
|
export type { I18NWrapperProps, I18NWrapperState } from './I18nWrapper';
|
|
30
|
-
export { mountWithIntlContext } from './mountWithIntlContext';
|
|
30
|
+
export { mountWithIntlContext, mountWithIntlWrapper, shallowWithIntlContext, } from './mountWithIntlContext';
|
|
31
31
|
export { fakeIntl } from './fakeI18n';
|
|
32
32
|
export { mockCanvas } from './mockCanvas';
|
|
33
33
|
export { default as KeyboardEventWithKeyCode } from './keyboardEventWithKeyCode';
|
|
@@ -1,3 +1,12 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { WrappedComponentProps } from 'react-intl-next';
|
|
3
|
+
import { ReactWrapper, ShallowWrapper } from 'enzyme';
|
|
4
|
+
import { ReactElement } from 'react';
|
|
5
|
+
export declare const mountWithIntlContext: <P, S, C extends React.Component<P, S, any> = React.Component<P, S, any>>(node: React.ReactElement<P & WrappedComponentProps<"intl">, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)> | null) | (new (props: any) => React.Component<any, any, any>)>, { context, childContextTypes, ...additionalOptions }?: {
|
|
6
|
+
context?: {} | undefined;
|
|
7
|
+
childContextTypes?: {} | undefined;
|
|
8
|
+
}) => ReactWrapper<P & WrappedComponentProps<"intl">, S, C>;
|
|
9
|
+
export declare const shallowWithIntlContext: <P, S, C extends React.Component<P, S, any> = React.Component<P, S, any>>(node: React.ReactElement<P & WrappedComponentProps<"intl">, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)> | null) | (new (props: any) => React.Component<any, any, any>)>, { context, ...additionalOptions }?: {
|
|
10
|
+
context?: {} | undefined;
|
|
11
|
+
}) => ShallowWrapper<P & WrappedComponentProps<"intl">, S, C>;
|
|
12
|
+
export declare const mountWithIntlWrapper: (node: React.ReactElement) => ReactWrapper;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/media-test-helpers",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "29.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/"
|
|
@@ -21,23 +21,23 @@
|
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@atlaskit/button": "^16.0.0",
|
|
23
23
|
"@atlaskit/checkbox": "^12.2.0",
|
|
24
|
-
"@atlaskit/icon": "^21.
|
|
24
|
+
"@atlaskit/icon": "^21.9.0",
|
|
25
25
|
"@atlaskit/locale": "^2.1.0",
|
|
26
|
-
"@atlaskit/media-client": "^14.
|
|
27
|
-
"@atlaskit/media-common": "^2.
|
|
26
|
+
"@atlaskit/media-client": "^14.3.0",
|
|
27
|
+
"@atlaskit/media-common": "^2.10.0",
|
|
28
28
|
"@atlaskit/media-core": "^32.2.0",
|
|
29
|
-
"@atlaskit/media-picker": "^
|
|
30
|
-
"@atlaskit/media-ui": "^
|
|
29
|
+
"@atlaskit/media-picker": "^59.0.0",
|
|
30
|
+
"@atlaskit/media-ui": "^18.0.0",
|
|
31
31
|
"@atlaskit/popup": "^1.1.0",
|
|
32
32
|
"@atlaskit/textfield": "^5.0.1",
|
|
33
|
-
"@atlaskit/tooltip": "^17.
|
|
33
|
+
"@atlaskit/tooltip": "^17.5.0",
|
|
34
34
|
"@babel/runtime": "^7.0.0",
|
|
35
35
|
"enzyme": "^3.10.0",
|
|
36
36
|
"exenv": "^1.2.2",
|
|
37
37
|
"kakapo": "^4.0.6",
|
|
38
38
|
"lodash": "^4.17.15",
|
|
39
39
|
"mock-socket": "^9.0.3",
|
|
40
|
-
"react-intl": "
|
|
40
|
+
"react-intl-next": "npm:react-intl@^5.18.1",
|
|
41
41
|
"react-redux": "^5.1.2",
|
|
42
42
|
"styled-components": "^3.2.6",
|
|
43
43
|
"uuid": "^3.1.0",
|