@storybook/test 0.0.0-pr-24225-sha-fa4f5fec → 0.0.0-pr-24225-sha-d42b137f

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. package/dist/index.d.ts +66 -71
  2. package/package.json +6 -6
package/dist/index.d.ts CHANGED
@@ -7,7 +7,7 @@ import * as domTestingLibrary from '@testing-library/dom';
7
7
 
8
8
  type Promisify<Fn> = Fn extends (...args: infer A) => infer R ? (...args: A) => R extends Promise<any> ? R : Promise<R> : Fn;
9
9
  type PromisifyObject<O> = {
10
- -readonly [K in keyof O]: Promisify<O[K]>;
10
+ [K in keyof O]: Promisify<O[K]>;
11
11
  };
12
12
 
13
13
  interface Assertion<T> extends PromisifyObject<JestAssertion<T>>, TestingLibraryMatchers<ReturnType<ExpectStatic['stringContaining']>, Promise<void>> {
@@ -31,81 +31,76 @@ interface Expect extends AsymmetricMatchersContaining {
31
31
  not: AsymmetricMatchersContaining;
32
32
  }
33
33
 
34
- declare const buildQueries: (queryAllBy: domTestingLibrary.GetAllBy<any[]>, getMultipleError: domTestingLibrary.GetErrorFunction<any[]>, getMissingError: domTestingLibrary.GetErrorFunction<any[]>) => Promise<domTestingLibrary.BuiltQueryMethods<any[]>>;
35
- declare const configure: (configDelta: domTestingLibrary.ConfigFn | Partial<domTestingLibrary.Config>) => Promise<void>;
36
- declare const createEvent: (eventName: string, node: Element | Node | Document | Window, init?: {} | undefined, options?: {
37
- EventType?: string | undefined;
38
- defaultInit?: {} | undefined;
39
- } | undefined) => Promise<Event>;
34
+ declare const buildQueries: typeof domTestingLibrary.buildQueries;
35
+ declare const configure: typeof domTestingLibrary.configure;
36
+ declare const createEvent: domTestingLibrary.CreateObject & domTestingLibrary.CreateFunction;
40
37
  declare const fireEvent: ((element: Element | Node | Document | Window, event: Event) => Promise<false> | Promise<true>) & PromisifyObject<domTestingLibrary.FireObject>;
41
- declare const findAllByAltText: (container: HTMLElement, id: domTestingLibrary.Matcher, options?: domTestingLibrary.MatcherOptions | undefined, waitForElementOptions?: domTestingLibrary.waitForOptions | undefined) => Promise<HTMLElement[]>;
42
- declare const findAllByDisplayValue: (container: HTMLElement, id: domTestingLibrary.Matcher, options?: domTestingLibrary.MatcherOptions | undefined, waitForElementOptions?: domTestingLibrary.waitForOptions | undefined) => Promise<HTMLElement[]>;
43
- declare const findAllByLabelText: (container: HTMLElement, id: domTestingLibrary.Matcher, options?: domTestingLibrary.SelectorMatcherOptions | undefined, waitForElementOptions?: domTestingLibrary.waitForOptions | undefined) => Promise<HTMLElement[]>;
44
- declare const findAllByPlaceholderText: (container: HTMLElement, id: domTestingLibrary.Matcher, options?: domTestingLibrary.MatcherOptions | undefined, waitForElementOptions?: domTestingLibrary.waitForOptions | undefined) => Promise<HTMLElement[]>;
45
- declare const findAllByRole: (container: HTMLElement, role: domTestingLibrary.ByRoleMatcher, options?: domTestingLibrary.ByRoleOptions | undefined, waitForElementOptions?: domTestingLibrary.waitForOptions | undefined) => Promise<HTMLElement[]>;
46
- declare const findAllByTestId: (container: HTMLElement, id: domTestingLibrary.Matcher, options?: domTestingLibrary.MatcherOptions | undefined, waitForElementOptions?: domTestingLibrary.waitForOptions | undefined) => Promise<HTMLElement[]>;
47
- declare const findAllByText: (container: HTMLElement, id: domTestingLibrary.Matcher, options?: domTestingLibrary.SelectorMatcherOptions | undefined, waitForElementOptions?: domTestingLibrary.waitForOptions | undefined) => Promise<HTMLElement[]>;
48
- declare const findAllByTitle: (container: HTMLElement, id: domTestingLibrary.Matcher, options?: domTestingLibrary.MatcherOptions | undefined, waitForElementOptions?: domTestingLibrary.waitForOptions | undefined) => Promise<HTMLElement[]>;
49
- declare const findByAltText: (container: HTMLElement, id: domTestingLibrary.Matcher, options?: domTestingLibrary.MatcherOptions | undefined, waitForElementOptions?: domTestingLibrary.waitForOptions | undefined) => Promise<HTMLElement>;
50
- declare const findByDisplayValue: (container: HTMLElement, id: domTestingLibrary.Matcher, options?: domTestingLibrary.MatcherOptions | undefined, waitForElementOptions?: domTestingLibrary.waitForOptions | undefined) => Promise<HTMLElement>;
51
- declare const findByLabelText: (container: HTMLElement, id: domTestingLibrary.Matcher, options?: domTestingLibrary.SelectorMatcherOptions | undefined, waitForElementOptions?: domTestingLibrary.waitForOptions | undefined) => Promise<HTMLElement>;
52
- declare const findByPlaceholderText: (container: HTMLElement, id: domTestingLibrary.Matcher, options?: domTestingLibrary.MatcherOptions | undefined, waitForElementOptions?: domTestingLibrary.waitForOptions | undefined) => Promise<HTMLElement>;
53
- declare const findByRole: (container: HTMLElement, role: domTestingLibrary.ByRoleMatcher, options?: domTestingLibrary.ByRoleOptions | undefined, waitForElementOptions?: domTestingLibrary.waitForOptions | undefined) => Promise<HTMLElement>;
54
- declare const findByTestId: (container: HTMLElement, id: domTestingLibrary.Matcher, options?: domTestingLibrary.MatcherOptions | undefined, waitForElementOptions?: domTestingLibrary.waitForOptions | undefined) => Promise<HTMLElement>;
55
- declare const findByText: (container: HTMLElement, id: domTestingLibrary.Matcher, options?: domTestingLibrary.SelectorMatcherOptions | undefined, waitForElementOptions?: domTestingLibrary.waitForOptions | undefined) => Promise<HTMLElement>;
56
- declare const findByTitle: (container: HTMLElement, id: domTestingLibrary.Matcher, options?: domTestingLibrary.MatcherOptions | undefined, waitForElementOptions?: domTestingLibrary.waitForOptions | undefined) => Promise<HTMLElement>;
57
- declare const getAllByAltText: (container: HTMLElement, id: domTestingLibrary.Matcher, options?: domTestingLibrary.MatcherOptions | undefined) => Promise<HTMLElement[]>;
58
- declare const getAllByDisplayValue: (container: HTMLElement, id: domTestingLibrary.Matcher, options?: domTestingLibrary.MatcherOptions | undefined) => Promise<HTMLElement[]>;
59
- declare const getAllByLabelText: (container: HTMLElement, id: domTestingLibrary.Matcher, options?: domTestingLibrary.SelectorMatcherOptions | undefined) => Promise<HTMLElement[]>;
60
- declare const getAllByPlaceholderText: (container: HTMLElement, id: domTestingLibrary.Matcher, options?: domTestingLibrary.MatcherOptions | undefined) => Promise<HTMLElement[]>;
61
- declare const getAllByRole: (container: HTMLElement, role: domTestingLibrary.ByRoleMatcher, options?: domTestingLibrary.ByRoleOptions | undefined) => Promise<HTMLElement[]>;
62
- declare const getAllByTestId: (container: HTMLElement, id: domTestingLibrary.Matcher, options?: domTestingLibrary.MatcherOptions | undefined) => Promise<HTMLElement[]>;
63
- declare const getAllByText: (container: HTMLElement, id: domTestingLibrary.Matcher, options?: domTestingLibrary.SelectorMatcherOptions | undefined) => Promise<HTMLElement[]>;
64
- declare const getAllByTitle: (container: HTMLElement, id: domTestingLibrary.Matcher, options?: domTestingLibrary.MatcherOptions | undefined) => Promise<HTMLElement[]>;
65
- declare const getByAltText: (container: HTMLElement, id: domTestingLibrary.Matcher, options?: domTestingLibrary.MatcherOptions | undefined) => Promise<HTMLElement>;
66
- declare const getByDisplayValue: (container: HTMLElement, id: domTestingLibrary.Matcher, options?: domTestingLibrary.MatcherOptions | undefined) => Promise<HTMLElement>;
67
- declare const getByLabelText: (container: HTMLElement, id: domTestingLibrary.Matcher, options?: domTestingLibrary.SelectorMatcherOptions | undefined) => Promise<HTMLElement>;
68
- declare const getByPlaceholderText: (container: HTMLElement, id: domTestingLibrary.Matcher, options?: domTestingLibrary.MatcherOptions | undefined) => Promise<HTMLElement>;
69
- declare const getByRole: (container: HTMLElement, role: domTestingLibrary.ByRoleMatcher, options?: domTestingLibrary.ByRoleOptions | undefined) => Promise<HTMLElement>;
70
- declare const getByTestId: (container: HTMLElement, id: domTestingLibrary.Matcher, options?: domTestingLibrary.MatcherOptions | undefined) => Promise<HTMLElement>;
71
- declare const getByText: (container: HTMLElement, id: domTestingLibrary.Matcher, options?: domTestingLibrary.SelectorMatcherOptions | undefined) => Promise<HTMLElement>;
72
- declare const getByTitle: (container: HTMLElement, id: domTestingLibrary.Matcher, options?: domTestingLibrary.MatcherOptions | undefined) => Promise<HTMLElement>;
73
- declare const getConfig: () => Promise<domTestingLibrary.Config>;
74
- declare const getDefaultNormalizer: (options?: domTestingLibrary.DefaultNormalizerOptions | undefined) => Promise<domTestingLibrary.NormalizerFn>;
75
- declare const getElementError: (message: string | null, container: HTMLElement) => Promise<Error>;
76
- declare const getNodeText: (node: HTMLElement) => Promise<string>;
38
+ declare const findAllByAltText: typeof domTestingLibrary.findAllByAltText;
39
+ declare const findAllByDisplayValue: typeof domTestingLibrary.findAllByDisplayValue;
40
+ declare const findAllByLabelText: typeof domTestingLibrary.findAllByLabelText;
41
+ declare const findAllByPlaceholderText: typeof domTestingLibrary.findAllByPlaceholderText;
42
+ declare const findAllByRole: typeof domTestingLibrary.findAllByRole;
43
+ declare const findAllByTestId: typeof domTestingLibrary.findAllByTestId;
44
+ declare const findAllByText: typeof domTestingLibrary.findAllByText;
45
+ declare const findAllByTitle: typeof domTestingLibrary.findAllByTitle;
46
+ declare const findByAltText: typeof domTestingLibrary.findByAltText;
47
+ declare const findByDisplayValue: typeof domTestingLibrary.findByDisplayValue;
48
+ declare const findByLabelText: typeof domTestingLibrary.findByLabelText;
49
+ declare const findByPlaceholderText: typeof domTestingLibrary.findByPlaceholderText;
50
+ declare const findByRole: typeof domTestingLibrary.findByRole;
51
+ declare const findByTestId: typeof domTestingLibrary.findByTestId;
52
+ declare const findByText: typeof domTestingLibrary.findByText;
53
+ declare const findByTitle: typeof domTestingLibrary.findByTitle;
54
+ declare const getAllByAltText: typeof domTestingLibrary.getAllByAltText;
55
+ declare const getAllByDisplayValue: typeof domTestingLibrary.getAllByDisplayValue;
56
+ declare const getAllByLabelText: typeof domTestingLibrary.getAllByLabelText;
57
+ declare const getAllByPlaceholderText: typeof domTestingLibrary.getAllByPlaceholderText;
58
+ declare const getAllByRole: typeof domTestingLibrary.getAllByRole;
59
+ declare const getAllByTestId: typeof domTestingLibrary.getAllByTestId;
60
+ declare const getAllByText: typeof domTestingLibrary.getAllByText;
61
+ declare const getAllByTitle: typeof domTestingLibrary.getAllByTitle;
62
+ declare const getByAltText: typeof domTestingLibrary.getByAltText;
63
+ declare const getByDisplayValue: typeof domTestingLibrary.getByDisplayValue;
64
+ declare const getByLabelText: typeof domTestingLibrary.getByLabelText;
65
+ declare const getByPlaceholderText: typeof domTestingLibrary.getByPlaceholderText;
66
+ declare const getByRole: typeof domTestingLibrary.getByRole;
67
+ declare const getByTestId: typeof domTestingLibrary.getByTestId;
68
+ declare const getByText: typeof domTestingLibrary.getByText;
69
+ declare const getByTitle: typeof domTestingLibrary.getByTitle;
70
+ declare const getConfig: typeof domTestingLibrary.getConfig;
71
+ declare const getDefaultNormalizer: typeof domTestingLibrary.getDefaultNormalizer;
72
+ declare const getElementError: typeof domTestingLibrary.getElementError;
73
+ declare const getNodeText: typeof domTestingLibrary.getNodeText;
77
74
  declare const getQueriesForElement: typeof domTestingLibrary.getQueriesForElement;
78
- declare const getRoles: (container: HTMLElement) => Promise<{
79
- [index: string]: HTMLElement[];
80
- }>;
81
- declare const getSuggestedQuery: (element: HTMLElement, variant?: domTestingLibrary.Variant | undefined, method?: domTestingLibrary.Method | undefined) => Promise<undefined> | Promise<domTestingLibrary.Suggestion>;
82
- declare const isInaccessible: (element: Element) => Promise<false> | Promise<true>;
83
- declare const logDOM: (dom?: Element | HTMLDocument | undefined, maxLength?: number | undefined, options?: domTestingLibrary.PrettyDOMOptions | undefined) => Promise<void>;
84
- declare const logRoles: (container: HTMLElement) => Promise<string>;
85
- declare const prettyDOM: (dom?: Element | HTMLDocument | undefined, maxLength?: number | undefined, options?: domTestingLibrary.PrettyDOMOptions | undefined) => Promise<false> | Promise<string>;
75
+ declare const getRoles: typeof domTestingLibrary.getRoles;
76
+ declare const getSuggestedQuery: typeof domTestingLibrary.getSuggestedQuery;
77
+ declare const isInaccessible: typeof domTestingLibrary.isInaccessible;
78
+ declare const logDOM: typeof domTestingLibrary.logDOM;
79
+ declare const logRoles: typeof domTestingLibrary.logRoles;
80
+ declare const prettyDOM: typeof domTestingLibrary.prettyDOM;
86
81
  declare const queries: typeof domTestingLibrary.queries;
87
- declare const queryAllByAltText: (container: HTMLElement, id: domTestingLibrary.Matcher, options?: domTestingLibrary.MatcherOptions | undefined) => Promise<HTMLElement[]>;
88
- declare const queryAllByAttribute: (attribute: string, container: HTMLElement, id: domTestingLibrary.Matcher, options?: domTestingLibrary.MatcherOptions | undefined) => Promise<HTMLElement[]>;
89
- declare const queryAllByDisplayValue: (container: HTMLElement, id: domTestingLibrary.Matcher, options?: domTestingLibrary.MatcherOptions | undefined) => Promise<HTMLElement[]>;
90
- declare const queryAllByLabelText: (container: HTMLElement, id: domTestingLibrary.Matcher, options?: domTestingLibrary.SelectorMatcherOptions | undefined) => Promise<HTMLElement[]>;
91
- declare const queryAllByPlaceholderText: (container: HTMLElement, id: domTestingLibrary.Matcher, options?: domTestingLibrary.MatcherOptions | undefined) => Promise<HTMLElement[]>;
92
- declare const queryAllByRole: (container: HTMLElement, role: domTestingLibrary.ByRoleMatcher, options?: domTestingLibrary.ByRoleOptions | undefined) => Promise<HTMLElement[]>;
93
- declare const queryAllByTestId: (container: HTMLElement, id: domTestingLibrary.Matcher, options?: domTestingLibrary.MatcherOptions | undefined) => Promise<HTMLElement[]>;
94
- declare const queryAllByText: (container: HTMLElement, id: domTestingLibrary.Matcher, options?: domTestingLibrary.SelectorMatcherOptions | undefined) => Promise<HTMLElement[]>;
95
- declare const queryAllByTitle: (container: HTMLElement, id: domTestingLibrary.Matcher, options?: domTestingLibrary.MatcherOptions | undefined) => Promise<HTMLElement[]>;
96
- declare const queryByAltText: (container: HTMLElement, id: domTestingLibrary.Matcher, options?: domTestingLibrary.MatcherOptions | undefined) => Promise<HTMLElement> | Promise<null>;
97
- declare const queryByAttribute: (attribute: string, container: HTMLElement, id: domTestingLibrary.Matcher, options?: domTestingLibrary.MatcherOptions | undefined) => Promise<HTMLElement> | Promise<null>;
98
- declare const queryByDisplayValue: (container: HTMLElement, id: domTestingLibrary.Matcher, options?: domTestingLibrary.MatcherOptions | undefined) => Promise<HTMLElement> | Promise<null>;
99
- declare const queryByLabelText: (container: HTMLElement, id: domTestingLibrary.Matcher, options?: domTestingLibrary.SelectorMatcherOptions | undefined) => Promise<HTMLElement> | Promise<null>;
100
- declare const queryByPlaceholderText: (container: HTMLElement, id: domTestingLibrary.Matcher, options?: domTestingLibrary.MatcherOptions | undefined) => Promise<HTMLElement> | Promise<null>;
101
- declare const queryByRole: (container: HTMLElement, role: domTestingLibrary.ByRoleMatcher, options?: domTestingLibrary.ByRoleOptions | undefined) => Promise<HTMLElement> | Promise<null>;
102
- declare const queryByTestId: (container: HTMLElement, id: domTestingLibrary.Matcher, options?: domTestingLibrary.MatcherOptions | undefined) => Promise<HTMLElement> | Promise<null>;
103
- declare const queryByText: (container: HTMLElement, id: domTestingLibrary.Matcher, options?: domTestingLibrary.SelectorMatcherOptions | undefined) => Promise<HTMLElement> | Promise<null>;
104
- declare const queryByTitle: (container: HTMLElement, id: domTestingLibrary.Matcher, options?: domTestingLibrary.MatcherOptions | undefined) => Promise<HTMLElement> | Promise<null>;
82
+ declare const queryAllByAltText: typeof domTestingLibrary.queryAllByAltText;
83
+ declare const queryAllByAttribute: domTestingLibrary.AllByAttribute;
84
+ declare const queryAllByDisplayValue: typeof domTestingLibrary.queryAllByDisplayValue;
85
+ declare const queryAllByLabelText: typeof domTestingLibrary.queryAllByLabelText;
86
+ declare const queryAllByPlaceholderText: typeof domTestingLibrary.queryAllByPlaceholderText;
87
+ declare const queryAllByRole: typeof domTestingLibrary.queryAllByRole;
88
+ declare const queryAllByTestId: typeof domTestingLibrary.queryAllByTestId;
89
+ declare const queryAllByText: typeof domTestingLibrary.queryAllByText;
90
+ declare const queryAllByTitle: typeof domTestingLibrary.queryAllByTitle;
91
+ declare const queryByAltText: typeof domTestingLibrary.queryByAltText;
92
+ declare const queryByAttribute: domTestingLibrary.QueryByAttribute;
93
+ declare const queryByDisplayValue: typeof domTestingLibrary.queryByDisplayValue;
94
+ declare const queryByLabelText: typeof domTestingLibrary.queryByLabelText;
95
+ declare const queryByPlaceholderText: typeof domTestingLibrary.queryByPlaceholderText;
96
+ declare const queryByRole: typeof domTestingLibrary.queryByRole;
97
+ declare const queryByTestId: typeof domTestingLibrary.queryByTestId;
98
+ declare const queryByText: typeof domTestingLibrary.queryByText;
99
+ declare const queryByTitle: typeof domTestingLibrary.queryByTitle;
105
100
  declare const queryHelpers: typeof domTestingLibrary.queryHelpers;
106
101
  declare const screen: domTestingLibrary.Screen<typeof domTestingLibrary.queries>;
107
- declare const waitFor: (callback: () => unknown, options?: domTestingLibrary.waitForOptions | undefined) => Promise<unknown>;
108
- declare const waitForElementToBeRemoved: (callback: unknown, options?: domTestingLibrary.waitForOptions | undefined) => Promise<void>;
102
+ declare const waitFor: typeof domTestingLibrary.waitFor;
103
+ declare const waitForElementToBeRemoved: typeof domTestingLibrary.waitForElementToBeRemoved;
109
104
  declare const within: typeof domTestingLibrary.getQueriesForElement;
110
105
  declare const prettyFormat: typeof domTestingLibrary.prettyFormat;
111
106
  declare const userEvent: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storybook/test",
3
- "version": "0.0.0-pr-24225-sha-fa4f5fec",
3
+ "version": "0.0.0-pr-24225-sha-d42b137f",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "storybook"
@@ -43,10 +43,10 @@
43
43
  "prep": "../../../scripts/prepare/bundle.ts"
44
44
  },
45
45
  "dependencies": {
46
- "@storybook/client-logger": "^0.0.0-pr-24225-sha-fa4f5fec",
47
- "@storybook/core-events": "^0.0.0-pr-24225-sha-fa4f5fec",
48
- "@storybook/instrumenter": "^0.0.0-pr-24225-sha-fa4f5fec",
49
- "@storybook/preview-api": "^0.0.0-pr-24225-sha-fa4f5fec",
46
+ "@storybook/client-logger": "0.0.0-pr-24225-sha-d42b137f",
47
+ "@storybook/core-events": "0.0.0-pr-24225-sha-d42b137f",
48
+ "@storybook/instrumenter": "0.0.0-pr-24225-sha-d42b137f",
49
+ "@storybook/preview-api": "0.0.0-pr-24225-sha-d42b137f",
50
50
  "@testing-library/dom": "^9.3.1",
51
51
  "@testing-library/jest-dom": "^6.1.3",
52
52
  "@testing-library/user-event": "^14.4.3",
@@ -58,7 +58,7 @@
58
58
  },
59
59
  "devDependencies": {
60
60
  "@types/chai": "^4",
61
- "type-fest": "~2.19",
61
+ "type-fest": "^2.19.0",
62
62
  "typescript": "~4.9.3"
63
63
  },
64
64
  "publishConfig": {