@newskit-render/shared-components 4.7.0-alpha.0 → 4.8.0-alpha.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/dist/cjs/helpers/testHelpers.d.ts +58 -2
- package/dist/cjs/helpers/testHelpers.js +5 -4
- package/dist/cjs/helpers/testHelpers.js.map +1 -1
- package/dist/esm/helpers/testHelpers.d.ts +58 -2
- package/dist/esm/helpers/testHelpers.js +5 -4
- package/dist/esm/helpers/testHelpers.js.map +1 -1
- package/package.json +2 -2
|
@@ -1,6 +1,62 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { RenderOptions } from '@testing-library/react';
|
|
3
2
|
import { UncompiledTheme } from 'newskit';
|
|
3
|
+
import { RenderOptions } from '@testing-library/react';
|
|
4
4
|
export declare const renderWithThemeTsl: <T extends {}>(Component: React.ComponentType<T>, props?: (T & {
|
|
5
5
|
children?: React.ReactNode;
|
|
6
|
-
}) | undefined, theme?: UncompiledTheme, options?: Omit<RenderOptions, 'wrapper'
|
|
6
|
+
}) | undefined, theme?: UncompiledTheme, options?: Omit<RenderOptions, 'wrapper'>, userEventOption?: Object) => {
|
|
7
|
+
container: HTMLElement;
|
|
8
|
+
baseElement: HTMLElement;
|
|
9
|
+
debug: (baseElement?: Element | DocumentFragment | (Element | DocumentFragment)[] | undefined, maxLength?: number | undefined, options?: import("pretty-format").PrettyFormatOptions | undefined) => void;
|
|
10
|
+
rerender: (ui: React.ReactElement<any, string | React.JSXElementConstructor<any>>) => void;
|
|
11
|
+
unmount: () => void;
|
|
12
|
+
asFragment: () => DocumentFragment;
|
|
13
|
+
getByLabelText: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").SelectorMatcherOptions | undefined) => HTMLElement;
|
|
14
|
+
getAllByLabelText: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").SelectorMatcherOptions | undefined) => HTMLElement[];
|
|
15
|
+
queryByLabelText: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").SelectorMatcherOptions | undefined) => HTMLElement | null;
|
|
16
|
+
queryAllByLabelText: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").SelectorMatcherOptions | undefined) => HTMLElement[];
|
|
17
|
+
findByLabelText: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").SelectorMatcherOptions | undefined, waitForElementOptions?: import("@testing-library/react").waitForOptions | undefined) => Promise<HTMLElement>;
|
|
18
|
+
findAllByLabelText: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").SelectorMatcherOptions | undefined, waitForElementOptions?: import("@testing-library/react").waitForOptions | undefined) => Promise<HTMLElement[]>;
|
|
19
|
+
getByPlaceholderText: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined) => HTMLElement;
|
|
20
|
+
getAllByPlaceholderText: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined) => HTMLElement[];
|
|
21
|
+
queryByPlaceholderText: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined) => HTMLElement | null;
|
|
22
|
+
queryAllByPlaceholderText: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined) => HTMLElement[];
|
|
23
|
+
findByPlaceholderText: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/react").waitForOptions | undefined) => Promise<HTMLElement>;
|
|
24
|
+
findAllByPlaceholderText: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/react").waitForOptions | undefined) => Promise<HTMLElement[]>;
|
|
25
|
+
getByText: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").SelectorMatcherOptions | undefined) => HTMLElement;
|
|
26
|
+
getAllByText: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").SelectorMatcherOptions | undefined) => HTMLElement[];
|
|
27
|
+
queryByText: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").SelectorMatcherOptions | undefined) => HTMLElement | null;
|
|
28
|
+
queryAllByText: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").SelectorMatcherOptions | undefined) => HTMLElement[];
|
|
29
|
+
findByText: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").SelectorMatcherOptions | undefined, waitForElementOptions?: import("@testing-library/react").waitForOptions | undefined) => Promise<HTMLElement>;
|
|
30
|
+
findAllByText: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").SelectorMatcherOptions | undefined, waitForElementOptions?: import("@testing-library/react").waitForOptions | undefined) => Promise<HTMLElement[]>;
|
|
31
|
+
getByAltText: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined) => HTMLElement;
|
|
32
|
+
getAllByAltText: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined) => HTMLElement[];
|
|
33
|
+
queryByAltText: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined) => HTMLElement | null;
|
|
34
|
+
queryAllByAltText: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined) => HTMLElement[];
|
|
35
|
+
findByAltText: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/react").waitForOptions | undefined) => Promise<HTMLElement>;
|
|
36
|
+
findAllByAltText: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/react").waitForOptions | undefined) => Promise<HTMLElement[]>;
|
|
37
|
+
getByTitle: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined) => HTMLElement;
|
|
38
|
+
getAllByTitle: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined) => HTMLElement[];
|
|
39
|
+
queryByTitle: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined) => HTMLElement | null;
|
|
40
|
+
queryAllByTitle: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined) => HTMLElement[];
|
|
41
|
+
findByTitle: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/react").waitForOptions | undefined) => Promise<HTMLElement>;
|
|
42
|
+
findAllByTitle: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/react").waitForOptions | undefined) => Promise<HTMLElement[]>;
|
|
43
|
+
getByDisplayValue: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined) => HTMLElement;
|
|
44
|
+
getAllByDisplayValue: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined) => HTMLElement[];
|
|
45
|
+
queryByDisplayValue: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined) => HTMLElement | null;
|
|
46
|
+
queryAllByDisplayValue: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined) => HTMLElement[];
|
|
47
|
+
findByDisplayValue: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/react").waitForOptions | undefined) => Promise<HTMLElement>;
|
|
48
|
+
findAllByDisplayValue: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/react").waitForOptions | undefined) => Promise<HTMLElement[]>;
|
|
49
|
+
getByRole: (role: import("@testing-library/react").ByRoleMatcher, options?: import("@testing-library/react").ByRoleOptions | undefined) => HTMLElement;
|
|
50
|
+
getAllByRole: (role: import("@testing-library/react").ByRoleMatcher, options?: import("@testing-library/react").ByRoleOptions | undefined) => HTMLElement[];
|
|
51
|
+
queryByRole: (role: import("@testing-library/react").ByRoleMatcher, options?: import("@testing-library/react").ByRoleOptions | undefined) => HTMLElement | null;
|
|
52
|
+
queryAllByRole: (role: import("@testing-library/react").ByRoleMatcher, options?: import("@testing-library/react").ByRoleOptions | undefined) => HTMLElement[];
|
|
53
|
+
findByRole: (role: import("@testing-library/react").ByRoleMatcher, options?: import("@testing-library/react").ByRoleOptions | undefined, waitForElementOptions?: import("@testing-library/react").waitForOptions | undefined) => Promise<HTMLElement>;
|
|
54
|
+
findAllByRole: (role: import("@testing-library/react").ByRoleMatcher, options?: import("@testing-library/react").ByRoleOptions | undefined, waitForElementOptions?: import("@testing-library/react").waitForOptions | undefined) => Promise<HTMLElement[]>;
|
|
55
|
+
getByTestId: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined) => HTMLElement;
|
|
56
|
+
getAllByTestId: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined) => HTMLElement[];
|
|
57
|
+
queryByTestId: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined) => HTMLElement | null;
|
|
58
|
+
queryAllByTestId: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined) => HTMLElement[];
|
|
59
|
+
findByTestId: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/react").waitForOptions | undefined) => Promise<HTMLElement>;
|
|
60
|
+
findAllByTestId: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/react").waitForOptions | undefined) => Promise<HTMLElement[]>;
|
|
61
|
+
user: import("@testing-library/user-event/dist/types/setup/setup").UserEvent;
|
|
62
|
+
};
|
|
@@ -33,14 +33,15 @@ Object.defineProperty(window, 'matchMedia', {
|
|
|
33
33
|
}); }),
|
|
34
34
|
});
|
|
35
35
|
var react_1 = __importDefault(require("react"));
|
|
36
|
-
var react_2 = require("@testing-library/react");
|
|
37
36
|
var newskit_1 = require("newskit");
|
|
38
|
-
var
|
|
37
|
+
var react_2 = require("@testing-library/react");
|
|
38
|
+
var user_event_1 = __importDefault(require("@testing-library/user-event"));
|
|
39
|
+
var renderWithThemeTsl = function (Component, props, theme, options, userEventOption) {
|
|
39
40
|
if (theme === void 0) { theme = newskit_1.newskitLightTheme; }
|
|
40
|
-
return (0, react_2.render)(react_1.default.createElement(Component, __assign({}, props)), __assign(__assign({}, options), { wrapper: function (_a) {
|
|
41
|
+
return __assign({ user: user_event_1.default.setup(userEventOption) }, (0, react_2.render)(react_1.default.createElement(Component, __assign({}, props)), __assign(__assign({}, options), { wrapper: function (_a) {
|
|
41
42
|
var children = _a.children;
|
|
42
43
|
return (react_1.default.createElement(newskit_1.ThemeProvider, { theme: theme }, children));
|
|
43
|
-
} }));
|
|
44
|
+
} })));
|
|
44
45
|
};
|
|
45
46
|
exports.renderWithThemeTsl = renderWithThemeTsl;
|
|
46
47
|
//# sourceMappingURL=testHelpers.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testHelpers.js","sourceRoot":"","sources":["../../../src/helpers/testHelpers.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,oGAAoG;AACpG;;GAEG;AACH,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,YAAY,EAAE;IAC1C,QAAQ,EAAE,IAAI;IACd,KAAK,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,kBAAkB,CAAC,UAAC,KAAK,IAAK,OAAA,CAAC;QAC9C,OAAO,EAAE,KAAK;QACd,KAAK,EAAE,KAAK;QACZ,QAAQ,EAAE,IAAI;QACd,WAAW,EAAE,IAAI,CAAC,EAAE,EAAE;QACtB,cAAc,EAAE,IAAI,CAAC,EAAE,EAAE;QACzB,gBAAgB,EAAE,IAAI,CAAC,EAAE,EAAE;QAC3B,mBAAmB,EAAE,IAAI,CAAC,EAAE,EAAE;QAC9B,aAAa,EAAE,IAAI,CAAC,EAAE,EAAE;KACzB,CAAC,EAT6C,CAS7C,CAAC;CACJ,CAAC,CAAA;AAEF,gDAAyB;AACzB,gDAA2E;AAC3E,
|
|
1
|
+
{"version":3,"file":"testHelpers.js","sourceRoot":"","sources":["../../../src/helpers/testHelpers.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,oGAAoG;AACpG;;GAEG;AACH,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,YAAY,EAAE;IAC1C,QAAQ,EAAE,IAAI;IACd,KAAK,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,kBAAkB,CAAC,UAAC,KAAK,IAAK,OAAA,CAAC;QAC9C,OAAO,EAAE,KAAK;QACd,KAAK,EAAE,KAAK;QACZ,QAAQ,EAAE,IAAI;QACd,WAAW,EAAE,IAAI,CAAC,EAAE,EAAE;QACtB,cAAc,EAAE,IAAI,CAAC,EAAE,EAAE;QACzB,gBAAgB,EAAE,IAAI,CAAC,EAAE,EAAE;QAC3B,mBAAmB,EAAE,IAAI,CAAC,EAAE,EAAE;QAC9B,aAAa,EAAE,IAAI,CAAC,EAAE,EAAE;KACzB,CAAC,EAT6C,CAS7C,CAAC;CACJ,CAAC,CAAA;AAEF,gDAAyB;AACzB,mCAA2E;AAC3E,gDAA2E;AAC3E,2EAAmD;AAE5C,IAAM,kBAAkB,GAAG,UAChC,SAAiC,EACjC,KAA0C,EAC1C,KAA0C,EAC1C,OAAwC,EACxC,eAAwB;IAFxB,sBAAA,EAAA,QAAyB,2BAAiB;IAI1C,kBACE,IAAI,EAAE,oBAAS,CAAC,KAAK,CAAC,eAAe,CAAC,IACnC,IAAA,cAAS,EAAC,8BAAC,SAAS,eAAM,KAAW,EAAI,wBACvC,OAAO,KACV,OAAO,EAAE,UAAC,EAAY;gBAAV,QAAQ,cAAA;YAAO,OAAA,CACzB,8BAAC,uBAAa,IAAC,KAAK,EAAE,KAAK,IAAG,QAAQ,CAAiB,CACxD;QAF0B,CAE1B,IACD,EACH;AACH,CAAC,CAAA;AAhBY,QAAA,kBAAkB,sBAgB9B"}
|
|
@@ -1,6 +1,62 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { RenderOptions } from '@testing-library/react';
|
|
3
2
|
import { UncompiledTheme } from 'newskit';
|
|
3
|
+
import { RenderOptions } from '@testing-library/react';
|
|
4
4
|
export declare const renderWithThemeTsl: <T extends {}>(Component: React.ComponentType<T>, props?: (T & {
|
|
5
5
|
children?: React.ReactNode;
|
|
6
|
-
}) | undefined, theme?: UncompiledTheme, options?: Omit<RenderOptions, 'wrapper'
|
|
6
|
+
}) | undefined, theme?: UncompiledTheme, options?: Omit<RenderOptions, 'wrapper'>, userEventOption?: Object) => {
|
|
7
|
+
container: HTMLElement;
|
|
8
|
+
baseElement: HTMLElement;
|
|
9
|
+
debug: (baseElement?: Element | DocumentFragment | (Element | DocumentFragment)[] | undefined, maxLength?: number | undefined, options?: import("pretty-format").PrettyFormatOptions | undefined) => void;
|
|
10
|
+
rerender: (ui: React.ReactElement<any, string | React.JSXElementConstructor<any>>) => void;
|
|
11
|
+
unmount: () => void;
|
|
12
|
+
asFragment: () => DocumentFragment;
|
|
13
|
+
getByLabelText: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").SelectorMatcherOptions | undefined) => HTMLElement;
|
|
14
|
+
getAllByLabelText: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").SelectorMatcherOptions | undefined) => HTMLElement[];
|
|
15
|
+
queryByLabelText: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").SelectorMatcherOptions | undefined) => HTMLElement | null;
|
|
16
|
+
queryAllByLabelText: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").SelectorMatcherOptions | undefined) => HTMLElement[];
|
|
17
|
+
findByLabelText: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").SelectorMatcherOptions | undefined, waitForElementOptions?: import("@testing-library/react").waitForOptions | undefined) => Promise<HTMLElement>;
|
|
18
|
+
findAllByLabelText: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").SelectorMatcherOptions | undefined, waitForElementOptions?: import("@testing-library/react").waitForOptions | undefined) => Promise<HTMLElement[]>;
|
|
19
|
+
getByPlaceholderText: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined) => HTMLElement;
|
|
20
|
+
getAllByPlaceholderText: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined) => HTMLElement[];
|
|
21
|
+
queryByPlaceholderText: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined) => HTMLElement | null;
|
|
22
|
+
queryAllByPlaceholderText: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined) => HTMLElement[];
|
|
23
|
+
findByPlaceholderText: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/react").waitForOptions | undefined) => Promise<HTMLElement>;
|
|
24
|
+
findAllByPlaceholderText: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/react").waitForOptions | undefined) => Promise<HTMLElement[]>;
|
|
25
|
+
getByText: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").SelectorMatcherOptions | undefined) => HTMLElement;
|
|
26
|
+
getAllByText: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").SelectorMatcherOptions | undefined) => HTMLElement[];
|
|
27
|
+
queryByText: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").SelectorMatcherOptions | undefined) => HTMLElement | null;
|
|
28
|
+
queryAllByText: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").SelectorMatcherOptions | undefined) => HTMLElement[];
|
|
29
|
+
findByText: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").SelectorMatcherOptions | undefined, waitForElementOptions?: import("@testing-library/react").waitForOptions | undefined) => Promise<HTMLElement>;
|
|
30
|
+
findAllByText: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").SelectorMatcherOptions | undefined, waitForElementOptions?: import("@testing-library/react").waitForOptions | undefined) => Promise<HTMLElement[]>;
|
|
31
|
+
getByAltText: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined) => HTMLElement;
|
|
32
|
+
getAllByAltText: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined) => HTMLElement[];
|
|
33
|
+
queryByAltText: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined) => HTMLElement | null;
|
|
34
|
+
queryAllByAltText: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined) => HTMLElement[];
|
|
35
|
+
findByAltText: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/react").waitForOptions | undefined) => Promise<HTMLElement>;
|
|
36
|
+
findAllByAltText: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/react").waitForOptions | undefined) => Promise<HTMLElement[]>;
|
|
37
|
+
getByTitle: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined) => HTMLElement;
|
|
38
|
+
getAllByTitle: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined) => HTMLElement[];
|
|
39
|
+
queryByTitle: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined) => HTMLElement | null;
|
|
40
|
+
queryAllByTitle: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined) => HTMLElement[];
|
|
41
|
+
findByTitle: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/react").waitForOptions | undefined) => Promise<HTMLElement>;
|
|
42
|
+
findAllByTitle: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/react").waitForOptions | undefined) => Promise<HTMLElement[]>;
|
|
43
|
+
getByDisplayValue: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined) => HTMLElement;
|
|
44
|
+
getAllByDisplayValue: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined) => HTMLElement[];
|
|
45
|
+
queryByDisplayValue: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined) => HTMLElement | null;
|
|
46
|
+
queryAllByDisplayValue: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined) => HTMLElement[];
|
|
47
|
+
findByDisplayValue: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/react").waitForOptions | undefined) => Promise<HTMLElement>;
|
|
48
|
+
findAllByDisplayValue: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/react").waitForOptions | undefined) => Promise<HTMLElement[]>;
|
|
49
|
+
getByRole: (role: import("@testing-library/react").ByRoleMatcher, options?: import("@testing-library/react").ByRoleOptions | undefined) => HTMLElement;
|
|
50
|
+
getAllByRole: (role: import("@testing-library/react").ByRoleMatcher, options?: import("@testing-library/react").ByRoleOptions | undefined) => HTMLElement[];
|
|
51
|
+
queryByRole: (role: import("@testing-library/react").ByRoleMatcher, options?: import("@testing-library/react").ByRoleOptions | undefined) => HTMLElement | null;
|
|
52
|
+
queryAllByRole: (role: import("@testing-library/react").ByRoleMatcher, options?: import("@testing-library/react").ByRoleOptions | undefined) => HTMLElement[];
|
|
53
|
+
findByRole: (role: import("@testing-library/react").ByRoleMatcher, options?: import("@testing-library/react").ByRoleOptions | undefined, waitForElementOptions?: import("@testing-library/react").waitForOptions | undefined) => Promise<HTMLElement>;
|
|
54
|
+
findAllByRole: (role: import("@testing-library/react").ByRoleMatcher, options?: import("@testing-library/react").ByRoleOptions | undefined, waitForElementOptions?: import("@testing-library/react").waitForOptions | undefined) => Promise<HTMLElement[]>;
|
|
55
|
+
getByTestId: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined) => HTMLElement;
|
|
56
|
+
getAllByTestId: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined) => HTMLElement[];
|
|
57
|
+
queryByTestId: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined) => HTMLElement | null;
|
|
58
|
+
queryAllByTestId: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined) => HTMLElement[];
|
|
59
|
+
findByTestId: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/react").waitForOptions | undefined) => Promise<HTMLElement>;
|
|
60
|
+
findAllByTestId: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/react").waitForOptions | undefined) => Promise<HTMLElement[]>;
|
|
61
|
+
user: import("@testing-library/user-event/dist/types/setup/setup").UserEvent;
|
|
62
|
+
};
|
|
@@ -27,13 +27,14 @@ Object.defineProperty(window, 'matchMedia', {
|
|
|
27
27
|
}); }),
|
|
28
28
|
});
|
|
29
29
|
import React from 'react';
|
|
30
|
-
import { render as renderTsl } from '@testing-library/react';
|
|
31
30
|
import { ThemeProvider, newskitLightTheme } from 'newskit';
|
|
32
|
-
|
|
31
|
+
import { render as renderTsl } from '@testing-library/react';
|
|
32
|
+
import userEvent from '@testing-library/user-event';
|
|
33
|
+
export var renderWithThemeTsl = function (Component, props, theme, options, userEventOption) {
|
|
33
34
|
if (theme === void 0) { theme = newskitLightTheme; }
|
|
34
|
-
return renderTsl(React.createElement(Component, __assign({}, props)), __assign(__assign({}, options), { wrapper: function (_a) {
|
|
35
|
+
return __assign({ user: userEvent.setup(userEventOption) }, renderTsl(React.createElement(Component, __assign({}, props)), __assign(__assign({}, options), { wrapper: function (_a) {
|
|
35
36
|
var children = _a.children;
|
|
36
37
|
return (React.createElement(ThemeProvider, { theme: theme }, children));
|
|
37
|
-
} }));
|
|
38
|
+
} })));
|
|
38
39
|
};
|
|
39
40
|
//# sourceMappingURL=testHelpers.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testHelpers.js","sourceRoot":"","sources":["../../../src/helpers/testHelpers.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,oGAAoG;AACpG;;GAEG;AACH,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,YAAY,EAAE;IAC1C,QAAQ,EAAE,IAAI;IACd,KAAK,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,kBAAkB,CAAC,UAAC,KAAK,IAAK,OAAA,CAAC;QAC9C,OAAO,EAAE,KAAK;QACd,KAAK,EAAE,KAAK;QACZ,QAAQ,EAAE,IAAI;QACd,WAAW,EAAE,IAAI,CAAC,EAAE,EAAE;QACtB,cAAc,EAAE,IAAI,CAAC,EAAE,EAAE;QACzB,gBAAgB,EAAE,IAAI,CAAC,EAAE,EAAE;QAC3B,mBAAmB,EAAE,IAAI,CAAC,EAAE,EAAE;QAC9B,aAAa,EAAE,IAAI,CAAC,EAAE,EAAE;KACzB,CAAC,EAT6C,CAS7C,CAAC;CACJ,CAAC,CAAA;AAEF,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,MAAM,IAAI,SAAS,EAAiB,MAAM,wBAAwB,CAAA;AAC3E,OAAO,
|
|
1
|
+
{"version":3,"file":"testHelpers.js","sourceRoot":"","sources":["../../../src/helpers/testHelpers.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,oGAAoG;AACpG;;GAEG;AACH,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,YAAY,EAAE;IAC1C,QAAQ,EAAE,IAAI;IACd,KAAK,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,kBAAkB,CAAC,UAAC,KAAK,IAAK,OAAA,CAAC;QAC9C,OAAO,EAAE,KAAK;QACd,KAAK,EAAE,KAAK;QACZ,QAAQ,EAAE,IAAI;QACd,WAAW,EAAE,IAAI,CAAC,EAAE,EAAE;QACtB,cAAc,EAAE,IAAI,CAAC,EAAE,EAAE;QACzB,gBAAgB,EAAE,IAAI,CAAC,EAAE,EAAE;QAC3B,mBAAmB,EAAE,IAAI,CAAC,EAAE,EAAE;QAC9B,aAAa,EAAE,IAAI,CAAC,EAAE,EAAE;KACzB,CAAC,EAT6C,CAS7C,CAAC;CACJ,CAAC,CAAA;AAEF,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAmB,aAAa,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAC3E,OAAO,EAAE,MAAM,IAAI,SAAS,EAAiB,MAAM,wBAAwB,CAAA;AAC3E,OAAO,SAAS,MAAM,6BAA6B,CAAA;AAEnD,MAAM,CAAC,IAAM,kBAAkB,GAAG,UAChC,SAAiC,EACjC,KAA0C,EAC1C,KAA0C,EAC1C,OAAwC,EACxC,eAAwB;IAFxB,sBAAA,EAAA,yBAA0C;IAI1C,kBACE,IAAI,EAAE,SAAS,CAAC,KAAK,CAAC,eAAe,CAAC,IACnC,SAAS,CAAC,oBAAC,SAAS,eAAM,KAAW,EAAI,wBACvC,OAAO,KACV,OAAO,EAAE,UAAC,EAAY;gBAAV,QAAQ,cAAA;YAAO,OAAA,CACzB,oBAAC,aAAa,IAAC,KAAK,EAAE,KAAK,IAAG,QAAQ,CAAiB,CACxD;QAF0B,CAE1B,IACD,EACH;AACH,CAAC,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@newskit-render/shared-components",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.8.0-alpha.0",
|
|
4
4
|
"description": "Newskit Render Shared Components",
|
|
5
5
|
"author": "",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"@newskit-render/validation": "^1.12.1",
|
|
51
51
|
"@storybook/addon-actions": "6.5.16",
|
|
52
52
|
"@storybook/react": "6.5.16",
|
|
53
|
-
"@testing-library/jest-dom": "6.1.
|
|
53
|
+
"@testing-library/jest-dom": "6.1.3",
|
|
54
54
|
"@testing-library/react": "14.0.0",
|
|
55
55
|
"@testing-library/user-event": "14.4.3",
|
|
56
56
|
"@types/jest": "27.0.2",
|