@mui/internal-test-utils 2.0.18-canary.1 → 2.0.18-canary.11
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/{esm/chaiPlugin.js → chaiPlugin.mjs} +1 -1
- package/{esm/createRenderer.d.ts → createRenderer.d.mts} +68 -59
- package/createRenderer.d.ts +67 -58
- package/createRenderer.js +21 -4
- package/{esm/createRenderer.js → createRenderer.mjs} +24 -7
- package/{esm/describeConformance.d.ts → describeConformance.d.mts} +2 -2
- package/{esm/describeConformance.js → describeConformance.mjs} +2 -2
- package/{esm/flushMicrotasks.js → flushMicrotasks.mjs} +1 -1
- package/{esm/focusVisible.js → focusVisible.mjs} +1 -1
- package/ignoreActWarnings.d.mts +1 -0
- package/ignoreActWarnings.d.ts +1 -0
- package/ignoreActWarnings.js +21 -0
- package/ignoreActWarnings.mjs +15 -0
- package/index.d.mts +11 -0
- package/index.d.ts +2 -1
- package/index.js +10 -2
- package/{esm/index.js → index.mjs} +10 -9
- package/initMatchers.d.mts +5 -0
- package/{esm/initMatchers.js → initMatchers.mjs} +2 -2
- package/package.json +57 -27
- package/{esm/setupVitest.d.ts → setupVitest.d.mts} +2 -2
- package/setupVitest.js +11 -9
- package/{esm/setupVitest.js → setupVitest.mjs} +14 -12
- package/esm/index.d.ts +0 -10
- package/esm/initMatchers.d.ts +0 -5
- package/esm/package.json +0 -1
- /package/{esm/chaiPlugin.d.ts → chaiPlugin.d.mts} +0 -0
- /package/{esm/chaiTypes.d.ts → chaiTypes.d.mts} +0 -0
- /package/{esm/chaiTypes.js → chaiTypes.mjs} +0 -0
- /package/{esm/components.d.ts → components.d.mts} +0 -0
- /package/{esm/components.js → components.mjs} +0 -0
- /package/{esm/configure.d.ts → configure.d.mts} +0 -0
- /package/{esm/configure.js → configure.mjs} +0 -0
- /package/{esm/createDescribe.d.ts → createDescribe.d.mts} +0 -0
- /package/{esm/createDescribe.js → createDescribe.mjs} +0 -0
- /package/{esm/env.d.ts → env.d.mts} +0 -0
- /package/{esm/env.js → env.mjs} +0 -0
- /package/{esm/flushMicrotasks.d.ts → flushMicrotasks.d.mts} +0 -0
- /package/{esm/focusVisible.d.ts → focusVisible.d.mts} +0 -0
- /package/{esm/initPlaywrightMatchers.d.ts → initPlaywrightMatchers.d.mts} +0 -0
- /package/{esm/initPlaywrightMatchers.js → initPlaywrightMatchers.mjs} +0 -0
|
@@ -5,7 +5,7 @@ import { computeAccessibleDescription, computeAccessibleName } from 'dom-accessi
|
|
|
5
5
|
import formatUtil from 'format-util';
|
|
6
6
|
import { kebabCase } from 'es-toolkit/string';
|
|
7
7
|
import { AssertionError } from 'assertion-error';
|
|
8
|
-
import { isJsdom } from "./env.
|
|
8
|
+
import { isJsdom } from "./env.mjs";
|
|
9
9
|
|
|
10
10
|
// chai#utils.elToString that looks like stringified elements in testing-library
|
|
11
11
|
function elementToString(element) {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { queries, RenderResult,
|
|
1
|
+
import { queries, RenderResult, Screen, RenderOptions as TestingLibraryRenderOptions } from '@testing-library/react/pure.js';
|
|
2
2
|
import { userEvent } from '@testing-library/user-event';
|
|
3
3
|
import * as React from 'react';
|
|
4
|
-
import {
|
|
5
|
-
import { flushMicrotasks } from "./flushMicrotasks.
|
|
4
|
+
import { vi } from 'vitest';
|
|
5
|
+
import { flushMicrotasks } from "./flushMicrotasks.mjs";
|
|
6
6
|
declare function queryAllDescriptionsOf(baseElement: HTMLElement, element: Element): HTMLElement[];
|
|
7
7
|
declare const customQueries: {
|
|
8
8
|
queryDescriptionOf: import("@testing-library/dom").QueryBy<[Element]>;
|
|
@@ -41,6 +41,10 @@ export interface MuiRenderResult extends RenderResult<typeof queries & typeof cu
|
|
|
41
41
|
* convenience helper. Better than repeating all props.
|
|
42
42
|
*/
|
|
43
43
|
setProps(props: object): void;
|
|
44
|
+
/**
|
|
45
|
+
* convenience helper. Better than repeating all props.
|
|
46
|
+
*/
|
|
47
|
+
setPropsAsync(props: object): Promise<void>;
|
|
44
48
|
}
|
|
45
49
|
export interface MuiRenderToStringResult {
|
|
46
50
|
container: HTMLElement;
|
|
@@ -65,6 +69,11 @@ export interface Clock {
|
|
|
65
69
|
* @param timeoutMS
|
|
66
70
|
*/
|
|
67
71
|
tick(timeoutMS: number): void;
|
|
72
|
+
/**
|
|
73
|
+
* Tick the clock ahead `timeoutMS` milliseconds. And also flush any microtasks queued in between.
|
|
74
|
+
* @param timeoutMS
|
|
75
|
+
*/
|
|
76
|
+
tickAsync(timeoutMS: number): Promise<void>;
|
|
68
77
|
/**
|
|
69
78
|
* Returns true if we're running with "real" i.e. native timers.
|
|
70
79
|
*/
|
|
@@ -79,7 +88,7 @@ export interface Clock {
|
|
|
79
88
|
restore(): void;
|
|
80
89
|
}
|
|
81
90
|
export type ClockConfig = undefined | number | Date;
|
|
82
|
-
declare function createClock(defaultMode: 'fake' | 'real', config: ClockConfig, options: Exclude<Parameters<typeof useFakeTimers>[0], number | Date>): Clock;
|
|
91
|
+
declare function createClock(defaultMode: 'fake' | 'real', config: ClockConfig, options: Exclude<Parameters<typeof vi.useFakeTimers>[0], number | Date>): Clock;
|
|
83
92
|
export interface Renderer {
|
|
84
93
|
clock: Clock;
|
|
85
94
|
render(element: React.ReactElement<DataAttributes>, options?: RenderOptions): MuiRenderResult;
|
|
@@ -95,68 +104,62 @@ export interface CreateRendererOptions extends Pick<RenderOptions, 'strict' | 's
|
|
|
95
104
|
emotion?: boolean;
|
|
96
105
|
}
|
|
97
106
|
export declare function createRenderer(globalOptions?: CreateRendererOptions): Renderer;
|
|
98
|
-
declare const fireEvent:
|
|
107
|
+
declare const fireEvent: import("@testing-library/dom").FireFunction & import("@testing-library/dom").FireObject;
|
|
99
108
|
export declare function fireTouchChangedEvent(target: Element, type: 'touchstart' | 'touchmove' | 'touchend', options: {
|
|
100
109
|
changedTouches: Array<Pick<TouchInit, 'clientX' | 'clientY'>>;
|
|
101
110
|
}): void;
|
|
102
111
|
declare function act<T>(callback: () => T | Promise<T>): Promise<T>;
|
|
103
112
|
declare function act(callback: () => void): void;
|
|
104
113
|
declare const bodyBoundQueries: {
|
|
105
|
-
getByLabelText<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").SelectorMatcherOptions | undefined):
|
|
106
|
-
getAllByLabelText<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").SelectorMatcherOptions | undefined):
|
|
107
|
-
queryByLabelText<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").SelectorMatcherOptions | undefined):
|
|
108
|
-
queryAllByLabelText<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").SelectorMatcherOptions | undefined):
|
|
109
|
-
findByLabelText<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").SelectorMatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined):
|
|
110
|
-
findAllByLabelText<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").SelectorMatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined):
|
|
111
|
-
getByPlaceholderText<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined):
|
|
112
|
-
getAllByPlaceholderText<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined):
|
|
113
|
-
queryByPlaceholderText<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined):
|
|
114
|
-
queryAllByPlaceholderText<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined):
|
|
115
|
-
findByPlaceholderText<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined):
|
|
116
|
-
findAllByPlaceholderText<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined):
|
|
117
|
-
getByText<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").SelectorMatcherOptions | undefined):
|
|
118
|
-
getAllByText<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").SelectorMatcherOptions | undefined):
|
|
119
|
-
queryByText<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").SelectorMatcherOptions | undefined):
|
|
120
|
-
queryAllByText<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").SelectorMatcherOptions | undefined):
|
|
121
|
-
findByText<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").SelectorMatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined):
|
|
122
|
-
findAllByText<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").SelectorMatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined):
|
|
123
|
-
getByAltText<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined):
|
|
124
|
-
getAllByAltText<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined):
|
|
125
|
-
queryByAltText<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined):
|
|
126
|
-
queryAllByAltText<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined):
|
|
127
|
-
findByAltText<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined):
|
|
128
|
-
findAllByAltText<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined):
|
|
129
|
-
getByTitle<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined):
|
|
130
|
-
getAllByTitle<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined):
|
|
131
|
-
queryByTitle<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined):
|
|
132
|
-
queryAllByTitle<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined):
|
|
133
|
-
findByTitle<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined):
|
|
134
|
-
findAllByTitle<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined):
|
|
135
|
-
getByDisplayValue<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined):
|
|
136
|
-
getAllByDisplayValue<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined):
|
|
137
|
-
queryByDisplayValue<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined):
|
|
138
|
-
queryAllByDisplayValue<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined):
|
|
139
|
-
findByDisplayValue<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined):
|
|
140
|
-
findAllByDisplayValue<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined):
|
|
141
|
-
getByRole<T extends HTMLElement = HTMLElement>(role: import("@testing-library/dom").ByRoleMatcher, options?: queries.ByRoleOptions | undefined):
|
|
142
|
-
getAllByRole<T extends HTMLElement = HTMLElement>(role: import("@testing-library/dom").ByRoleMatcher, options?: queries.ByRoleOptions | undefined):
|
|
143
|
-
queryByRole<T extends HTMLElement = HTMLElement>(role: import("@testing-library/dom").ByRoleMatcher, options?: queries.ByRoleOptions | undefined):
|
|
144
|
-
queryAllByRole<T extends HTMLElement = HTMLElement>(role: import("@testing-library/dom").ByRoleMatcher, options?: queries.ByRoleOptions | undefined):
|
|
145
|
-
findByRole<T extends HTMLElement = HTMLElement>(role: import("@testing-library/dom").ByRoleMatcher, options?: queries.ByRoleOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined):
|
|
146
|
-
findAllByRole<T extends HTMLElement = HTMLElement>(role: import("@testing-library/dom").ByRoleMatcher, options?: queries.ByRoleOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined):
|
|
147
|
-
getByTestId<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined):
|
|
148
|
-
getAllByTestId<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined):
|
|
149
|
-
queryByTestId<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined):
|
|
150
|
-
queryAllByTestId<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined):
|
|
151
|
-
findByTestId<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined):
|
|
152
|
-
findAllByTestId<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined):
|
|
114
|
+
getByLabelText<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").SelectorMatcherOptions | undefined): T;
|
|
115
|
+
getAllByLabelText<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").SelectorMatcherOptions | undefined): T[];
|
|
116
|
+
queryByLabelText<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").SelectorMatcherOptions | undefined): T | null;
|
|
117
|
+
queryAllByLabelText<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").SelectorMatcherOptions | undefined): T[];
|
|
118
|
+
findByLabelText<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").SelectorMatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined): Promise<T>;
|
|
119
|
+
findAllByLabelText<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").SelectorMatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined): Promise<T[]>;
|
|
120
|
+
getByPlaceholderText<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined): T;
|
|
121
|
+
getAllByPlaceholderText<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined): T[];
|
|
122
|
+
queryByPlaceholderText<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined): T | null;
|
|
123
|
+
queryAllByPlaceholderText<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined): T[];
|
|
124
|
+
findByPlaceholderText<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined): Promise<T>;
|
|
125
|
+
findAllByPlaceholderText<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined): Promise<T[]>;
|
|
126
|
+
getByText<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").SelectorMatcherOptions | undefined): T;
|
|
127
|
+
getAllByText<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").SelectorMatcherOptions | undefined): T[];
|
|
128
|
+
queryByText<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").SelectorMatcherOptions | undefined): T | null;
|
|
129
|
+
queryAllByText<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").SelectorMatcherOptions | undefined): T[];
|
|
130
|
+
findByText<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").SelectorMatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined): Promise<T>;
|
|
131
|
+
findAllByText<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").SelectorMatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined): Promise<T[]>;
|
|
132
|
+
getByAltText<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined): T;
|
|
133
|
+
getAllByAltText<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined): T[];
|
|
134
|
+
queryByAltText<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined): T | null;
|
|
135
|
+
queryAllByAltText<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined): T[];
|
|
136
|
+
findByAltText<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined): Promise<T>;
|
|
137
|
+
findAllByAltText<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined): Promise<T[]>;
|
|
138
|
+
getByTitle<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined): T;
|
|
139
|
+
getAllByTitle<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined): T[];
|
|
140
|
+
queryByTitle<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined): T | null;
|
|
141
|
+
queryAllByTitle<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined): T[];
|
|
142
|
+
findByTitle<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined): Promise<T>;
|
|
143
|
+
findAllByTitle<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined): Promise<T[]>;
|
|
144
|
+
getByDisplayValue<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined): T;
|
|
145
|
+
getAllByDisplayValue<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined): T[];
|
|
146
|
+
queryByDisplayValue<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined): T | null;
|
|
147
|
+
queryAllByDisplayValue<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined): T[];
|
|
148
|
+
findByDisplayValue<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined): Promise<T>;
|
|
149
|
+
findAllByDisplayValue<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined): Promise<T[]>;
|
|
150
|
+
getByRole<T extends HTMLElement = HTMLElement>(role: import("@testing-library/dom").ByRoleMatcher, options?: queries.ByRoleOptions | undefined): T;
|
|
151
|
+
getAllByRole<T extends HTMLElement = HTMLElement>(role: import("@testing-library/dom").ByRoleMatcher, options?: queries.ByRoleOptions | undefined): T[];
|
|
152
|
+
queryByRole<T extends HTMLElement = HTMLElement>(role: import("@testing-library/dom").ByRoleMatcher, options?: queries.ByRoleOptions | undefined): T | null;
|
|
153
|
+
queryAllByRole<T extends HTMLElement = HTMLElement>(role: import("@testing-library/dom").ByRoleMatcher, options?: queries.ByRoleOptions | undefined): T[];
|
|
154
|
+
findByRole<T extends HTMLElement = HTMLElement>(role: import("@testing-library/dom").ByRoleMatcher, options?: queries.ByRoleOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined): Promise<T>;
|
|
155
|
+
findAllByRole<T extends HTMLElement = HTMLElement>(role: import("@testing-library/dom").ByRoleMatcher, options?: queries.ByRoleOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined): Promise<T[]>;
|
|
156
|
+
getByTestId<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined): T;
|
|
157
|
+
getAllByTestId<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined): T[];
|
|
158
|
+
queryByTestId<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined): T | null;
|
|
159
|
+
queryAllByTestId<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined): T[];
|
|
160
|
+
findByTestId<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined): Promise<T>;
|
|
161
|
+
findAllByTestId<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined): Promise<T[]>;
|
|
153
162
|
} & {
|
|
154
|
-
queryDescriptionOf: (args_0: Element) => HTMLElement | null;
|
|
155
|
-
queryAllDescriptionsOf: (element: Element) => HTMLElement[];
|
|
156
|
-
getDescriptionOf: (args_0: Element) => HTMLElement;
|
|
157
|
-
getAllDescriptionsOf: (args_0: Element) => HTMLElement[];
|
|
158
|
-
findDescriptionOf: (args_0: Element, args_1?: undefined, args_2?: import("@testing-library/dom").waitForOptions | undefined) => Promise<HTMLElement>;
|
|
159
|
-
findAllDescriptionsOf: (args_0: Element, args_1?: undefined, args_2?: import("@testing-library/dom").waitForOptions | undefined) => Promise<HTMLElement[]>;
|
|
160
163
|
getByLabelText: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").SelectorMatcherOptions | undefined) => HTMLElement;
|
|
161
164
|
getAllByLabelText: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").SelectorMatcherOptions | undefined) => HTMLElement[];
|
|
162
165
|
queryByLabelText: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").SelectorMatcherOptions | undefined) => HTMLElement | null;
|
|
@@ -205,6 +208,12 @@ declare const bodyBoundQueries: {
|
|
|
205
208
|
queryAllByTestId: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined) => HTMLElement[];
|
|
206
209
|
findByTestId: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined) => Promise<HTMLElement>;
|
|
207
210
|
findAllByTestId: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined) => Promise<HTMLElement[]>;
|
|
211
|
+
queryDescriptionOf: (args_0: Element) => HTMLElement | null;
|
|
212
|
+
queryAllDescriptionsOf: (element: Element) => HTMLElement[];
|
|
213
|
+
getDescriptionOf: (args_0: Element) => HTMLElement;
|
|
214
|
+
getAllDescriptionsOf: (args_0: Element) => HTMLElement[];
|
|
215
|
+
findDescriptionOf: (args_0: Element, args_1?: undefined, args_2?: import("@testing-library/dom").waitForOptions | undefined) => Promise<HTMLElement>;
|
|
216
|
+
findAllDescriptionsOf: (args_0: Element, args_1?: undefined, args_2?: import("@testing-library/dom").waitForOptions | undefined) => Promise<HTMLElement[]>;
|
|
208
217
|
};
|
|
209
218
|
export { configure, render, renderHook, waitFor, within, cleanup, createEvent, type RenderHookResult, type EventType } from '@testing-library/react/pure.js';
|
|
210
219
|
export { act, fireEvent };
|
package/createRenderer.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { queries, RenderResult,
|
|
1
|
+
import { queries, RenderResult, Screen, RenderOptions as TestingLibraryRenderOptions } from '@testing-library/react/pure.js';
|
|
2
2
|
import { userEvent } from '@testing-library/user-event';
|
|
3
3
|
import * as React from 'react';
|
|
4
|
-
import {
|
|
4
|
+
import { vi } from 'vitest';
|
|
5
5
|
import { flushMicrotasks } from "./flushMicrotasks.js";
|
|
6
6
|
declare function queryAllDescriptionsOf(baseElement: HTMLElement, element: Element): HTMLElement[];
|
|
7
7
|
declare const customQueries: {
|
|
@@ -41,6 +41,10 @@ export interface MuiRenderResult extends RenderResult<typeof queries & typeof cu
|
|
|
41
41
|
* convenience helper. Better than repeating all props.
|
|
42
42
|
*/
|
|
43
43
|
setProps(props: object): void;
|
|
44
|
+
/**
|
|
45
|
+
* convenience helper. Better than repeating all props.
|
|
46
|
+
*/
|
|
47
|
+
setPropsAsync(props: object): Promise<void>;
|
|
44
48
|
}
|
|
45
49
|
export interface MuiRenderToStringResult {
|
|
46
50
|
container: HTMLElement;
|
|
@@ -65,6 +69,11 @@ export interface Clock {
|
|
|
65
69
|
* @param timeoutMS
|
|
66
70
|
*/
|
|
67
71
|
tick(timeoutMS: number): void;
|
|
72
|
+
/**
|
|
73
|
+
* Tick the clock ahead `timeoutMS` milliseconds. And also flush any microtasks queued in between.
|
|
74
|
+
* @param timeoutMS
|
|
75
|
+
*/
|
|
76
|
+
tickAsync(timeoutMS: number): Promise<void>;
|
|
68
77
|
/**
|
|
69
78
|
* Returns true if we're running with "real" i.e. native timers.
|
|
70
79
|
*/
|
|
@@ -79,7 +88,7 @@ export interface Clock {
|
|
|
79
88
|
restore(): void;
|
|
80
89
|
}
|
|
81
90
|
export type ClockConfig = undefined | number | Date;
|
|
82
|
-
declare function createClock(defaultMode: 'fake' | 'real', config: ClockConfig, options: Exclude<Parameters<typeof useFakeTimers>[0], number | Date>): Clock;
|
|
91
|
+
declare function createClock(defaultMode: 'fake' | 'real', config: ClockConfig, options: Exclude<Parameters<typeof vi.useFakeTimers>[0], number | Date>): Clock;
|
|
83
92
|
export interface Renderer {
|
|
84
93
|
clock: Clock;
|
|
85
94
|
render(element: React.ReactElement<DataAttributes>, options?: RenderOptions): MuiRenderResult;
|
|
@@ -95,68 +104,62 @@ export interface CreateRendererOptions extends Pick<RenderOptions, 'strict' | 's
|
|
|
95
104
|
emotion?: boolean;
|
|
96
105
|
}
|
|
97
106
|
export declare function createRenderer(globalOptions?: CreateRendererOptions): Renderer;
|
|
98
|
-
declare const fireEvent:
|
|
107
|
+
declare const fireEvent: import("@testing-library/dom").FireFunction & import("@testing-library/dom").FireObject;
|
|
99
108
|
export declare function fireTouchChangedEvent(target: Element, type: 'touchstart' | 'touchmove' | 'touchend', options: {
|
|
100
109
|
changedTouches: Array<Pick<TouchInit, 'clientX' | 'clientY'>>;
|
|
101
110
|
}): void;
|
|
102
111
|
declare function act<T>(callback: () => T | Promise<T>): Promise<T>;
|
|
103
112
|
declare function act(callback: () => void): void;
|
|
104
113
|
declare const bodyBoundQueries: {
|
|
105
|
-
getByLabelText<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").SelectorMatcherOptions | undefined):
|
|
106
|
-
getAllByLabelText<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").SelectorMatcherOptions | undefined):
|
|
107
|
-
queryByLabelText<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").SelectorMatcherOptions | undefined):
|
|
108
|
-
queryAllByLabelText<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").SelectorMatcherOptions | undefined):
|
|
109
|
-
findByLabelText<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").SelectorMatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined):
|
|
110
|
-
findAllByLabelText<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").SelectorMatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined):
|
|
111
|
-
getByPlaceholderText<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined):
|
|
112
|
-
getAllByPlaceholderText<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined):
|
|
113
|
-
queryByPlaceholderText<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined):
|
|
114
|
-
queryAllByPlaceholderText<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined):
|
|
115
|
-
findByPlaceholderText<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined):
|
|
116
|
-
findAllByPlaceholderText<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined):
|
|
117
|
-
getByText<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").SelectorMatcherOptions | undefined):
|
|
118
|
-
getAllByText<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").SelectorMatcherOptions | undefined):
|
|
119
|
-
queryByText<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").SelectorMatcherOptions | undefined):
|
|
120
|
-
queryAllByText<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").SelectorMatcherOptions | undefined):
|
|
121
|
-
findByText<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").SelectorMatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined):
|
|
122
|
-
findAllByText<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").SelectorMatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined):
|
|
123
|
-
getByAltText<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined):
|
|
124
|
-
getAllByAltText<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined):
|
|
125
|
-
queryByAltText<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined):
|
|
126
|
-
queryAllByAltText<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined):
|
|
127
|
-
findByAltText<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined):
|
|
128
|
-
findAllByAltText<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined):
|
|
129
|
-
getByTitle<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined):
|
|
130
|
-
getAllByTitle<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined):
|
|
131
|
-
queryByTitle<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined):
|
|
132
|
-
queryAllByTitle<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined):
|
|
133
|
-
findByTitle<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined):
|
|
134
|
-
findAllByTitle<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined):
|
|
135
|
-
getByDisplayValue<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined):
|
|
136
|
-
getAllByDisplayValue<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined):
|
|
137
|
-
queryByDisplayValue<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined):
|
|
138
|
-
queryAllByDisplayValue<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined):
|
|
139
|
-
findByDisplayValue<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined):
|
|
140
|
-
findAllByDisplayValue<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined):
|
|
141
|
-
getByRole<T extends HTMLElement = HTMLElement>(role: import("@testing-library/dom").ByRoleMatcher, options?: queries.ByRoleOptions | undefined):
|
|
142
|
-
getAllByRole<T extends HTMLElement = HTMLElement>(role: import("@testing-library/dom").ByRoleMatcher, options?: queries.ByRoleOptions | undefined):
|
|
143
|
-
queryByRole<T extends HTMLElement = HTMLElement>(role: import("@testing-library/dom").ByRoleMatcher, options?: queries.ByRoleOptions | undefined):
|
|
144
|
-
queryAllByRole<T extends HTMLElement = HTMLElement>(role: import("@testing-library/dom").ByRoleMatcher, options?: queries.ByRoleOptions | undefined):
|
|
145
|
-
findByRole<T extends HTMLElement = HTMLElement>(role: import("@testing-library/dom").ByRoleMatcher, options?: queries.ByRoleOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined):
|
|
146
|
-
findAllByRole<T extends HTMLElement = HTMLElement>(role: import("@testing-library/dom").ByRoleMatcher, options?: queries.ByRoleOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined):
|
|
147
|
-
getByTestId<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined):
|
|
148
|
-
getAllByTestId<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined):
|
|
149
|
-
queryByTestId<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined):
|
|
150
|
-
queryAllByTestId<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined):
|
|
151
|
-
findByTestId<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined):
|
|
152
|
-
findAllByTestId<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined):
|
|
114
|
+
getByLabelText<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").SelectorMatcherOptions | undefined): T;
|
|
115
|
+
getAllByLabelText<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").SelectorMatcherOptions | undefined): T[];
|
|
116
|
+
queryByLabelText<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").SelectorMatcherOptions | undefined): T | null;
|
|
117
|
+
queryAllByLabelText<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").SelectorMatcherOptions | undefined): T[];
|
|
118
|
+
findByLabelText<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").SelectorMatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined): Promise<T>;
|
|
119
|
+
findAllByLabelText<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").SelectorMatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined): Promise<T[]>;
|
|
120
|
+
getByPlaceholderText<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined): T;
|
|
121
|
+
getAllByPlaceholderText<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined): T[];
|
|
122
|
+
queryByPlaceholderText<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined): T | null;
|
|
123
|
+
queryAllByPlaceholderText<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined): T[];
|
|
124
|
+
findByPlaceholderText<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined): Promise<T>;
|
|
125
|
+
findAllByPlaceholderText<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined): Promise<T[]>;
|
|
126
|
+
getByText<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").SelectorMatcherOptions | undefined): T;
|
|
127
|
+
getAllByText<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").SelectorMatcherOptions | undefined): T[];
|
|
128
|
+
queryByText<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").SelectorMatcherOptions | undefined): T | null;
|
|
129
|
+
queryAllByText<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").SelectorMatcherOptions | undefined): T[];
|
|
130
|
+
findByText<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").SelectorMatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined): Promise<T>;
|
|
131
|
+
findAllByText<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").SelectorMatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined): Promise<T[]>;
|
|
132
|
+
getByAltText<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined): T;
|
|
133
|
+
getAllByAltText<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined): T[];
|
|
134
|
+
queryByAltText<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined): T | null;
|
|
135
|
+
queryAllByAltText<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined): T[];
|
|
136
|
+
findByAltText<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined): Promise<T>;
|
|
137
|
+
findAllByAltText<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined): Promise<T[]>;
|
|
138
|
+
getByTitle<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined): T;
|
|
139
|
+
getAllByTitle<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined): T[];
|
|
140
|
+
queryByTitle<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined): T | null;
|
|
141
|
+
queryAllByTitle<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined): T[];
|
|
142
|
+
findByTitle<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined): Promise<T>;
|
|
143
|
+
findAllByTitle<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined): Promise<T[]>;
|
|
144
|
+
getByDisplayValue<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined): T;
|
|
145
|
+
getAllByDisplayValue<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined): T[];
|
|
146
|
+
queryByDisplayValue<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined): T | null;
|
|
147
|
+
queryAllByDisplayValue<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined): T[];
|
|
148
|
+
findByDisplayValue<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined): Promise<T>;
|
|
149
|
+
findAllByDisplayValue<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined): Promise<T[]>;
|
|
150
|
+
getByRole<T extends HTMLElement = HTMLElement>(role: import("@testing-library/dom").ByRoleMatcher, options?: queries.ByRoleOptions | undefined): T;
|
|
151
|
+
getAllByRole<T extends HTMLElement = HTMLElement>(role: import("@testing-library/dom").ByRoleMatcher, options?: queries.ByRoleOptions | undefined): T[];
|
|
152
|
+
queryByRole<T extends HTMLElement = HTMLElement>(role: import("@testing-library/dom").ByRoleMatcher, options?: queries.ByRoleOptions | undefined): T | null;
|
|
153
|
+
queryAllByRole<T extends HTMLElement = HTMLElement>(role: import("@testing-library/dom").ByRoleMatcher, options?: queries.ByRoleOptions | undefined): T[];
|
|
154
|
+
findByRole<T extends HTMLElement = HTMLElement>(role: import("@testing-library/dom").ByRoleMatcher, options?: queries.ByRoleOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined): Promise<T>;
|
|
155
|
+
findAllByRole<T extends HTMLElement = HTMLElement>(role: import("@testing-library/dom").ByRoleMatcher, options?: queries.ByRoleOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined): Promise<T[]>;
|
|
156
|
+
getByTestId<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined): T;
|
|
157
|
+
getAllByTestId<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined): T[];
|
|
158
|
+
queryByTestId<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined): T | null;
|
|
159
|
+
queryAllByTestId<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined): T[];
|
|
160
|
+
findByTestId<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined): Promise<T>;
|
|
161
|
+
findAllByTestId<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined): Promise<T[]>;
|
|
153
162
|
} & {
|
|
154
|
-
queryDescriptionOf: (args_0: Element) => HTMLElement | null;
|
|
155
|
-
queryAllDescriptionsOf: (element: Element) => HTMLElement[];
|
|
156
|
-
getDescriptionOf: (args_0: Element) => HTMLElement;
|
|
157
|
-
getAllDescriptionsOf: (args_0: Element) => HTMLElement[];
|
|
158
|
-
findDescriptionOf: (args_0: Element, args_1?: undefined, args_2?: import("@testing-library/dom").waitForOptions | undefined) => Promise<HTMLElement>;
|
|
159
|
-
findAllDescriptionsOf: (args_0: Element, args_1?: undefined, args_2?: import("@testing-library/dom").waitForOptions | undefined) => Promise<HTMLElement[]>;
|
|
160
163
|
getByLabelText: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").SelectorMatcherOptions | undefined) => HTMLElement;
|
|
161
164
|
getAllByLabelText: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").SelectorMatcherOptions | undefined) => HTMLElement[];
|
|
162
165
|
queryByLabelText: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").SelectorMatcherOptions | undefined) => HTMLElement | null;
|
|
@@ -205,6 +208,12 @@ declare const bodyBoundQueries: {
|
|
|
205
208
|
queryAllByTestId: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined) => HTMLElement[];
|
|
206
209
|
findByTestId: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined) => Promise<HTMLElement>;
|
|
207
210
|
findAllByTestId: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined) => Promise<HTMLElement[]>;
|
|
211
|
+
queryDescriptionOf: (args_0: Element) => HTMLElement | null;
|
|
212
|
+
queryAllDescriptionsOf: (element: Element) => HTMLElement[];
|
|
213
|
+
getDescriptionOf: (args_0: Element) => HTMLElement;
|
|
214
|
+
getAllDescriptionsOf: (args_0: Element) => HTMLElement[];
|
|
215
|
+
findDescriptionOf: (args_0: Element, args_1?: undefined, args_2?: import("@testing-library/dom").waitForOptions | undefined) => Promise<HTMLElement>;
|
|
216
|
+
findAllDescriptionsOf: (args_0: Element, args_1?: undefined, args_2?: import("@testing-library/dom").waitForOptions | undefined) => Promise<HTMLElement[]>;
|
|
208
217
|
};
|
|
209
218
|
export { configure, render, renderHook, waitFor, within, cleanup, createEvent, type RenderHookResult, type EventType } from '@testing-library/react/pure.js';
|
|
210
219
|
export { act, fireEvent };
|
package/createRenderer.js
CHANGED
|
@@ -117,6 +117,11 @@ function render(element, configuration) {
|
|
|
117
117
|
},
|
|
118
118
|
setProps(props) {
|
|
119
119
|
testingLibraryRenderResult.rerender(/*#__PURE__*/React.cloneElement(element, props));
|
|
120
|
+
},
|
|
121
|
+
async setPropsAsync(props) {
|
|
122
|
+
await (0, _pure.act)(async () => {
|
|
123
|
+
testingLibraryRenderResult.rerender(/*#__PURE__*/React.cloneElement(element, props));
|
|
124
|
+
});
|
|
120
125
|
}
|
|
121
126
|
};
|
|
122
127
|
return result;
|
|
@@ -198,6 +203,11 @@ function createClock(defaultMode, config, options) {
|
|
|
198
203
|
_vitest.vi.advanceTimersByTime(timeoutMS);
|
|
199
204
|
});
|
|
200
205
|
},
|
|
206
|
+
async tickAsync(timeoutMS) {
|
|
207
|
+
await (0, _pure.act)(async () => {
|
|
208
|
+
await _vitest.vi.advanceTimersByTimeAsync(timeoutMS);
|
|
209
|
+
});
|
|
210
|
+
},
|
|
201
211
|
runAll() {
|
|
202
212
|
(0, _pure.act)(() => {
|
|
203
213
|
_vitest.vi.runAllTimers();
|
|
@@ -411,10 +421,17 @@ function fireTouchChangedEvent(target, type, options) {
|
|
|
411
421
|
function act(callback) {
|
|
412
422
|
return (0, _pure.act)(callback);
|
|
413
423
|
}
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
424
|
+
function createBodyBoundQueries() {
|
|
425
|
+
return (0, _pure.within)(document.body, {
|
|
426
|
+
..._pure.queries,
|
|
427
|
+
...customQueries
|
|
428
|
+
});
|
|
429
|
+
}
|
|
430
|
+
const bodyBoundQueries = typeof document === 'undefined' ? new Proxy({}, {
|
|
431
|
+
get: () => {
|
|
432
|
+
throw new Error('bodyBoundQueries is not available in a non-DOM environment');
|
|
433
|
+
}
|
|
434
|
+
}) : createBodyBoundQueries();
|
|
418
435
|
const screen = exports.screen = {
|
|
419
436
|
..._pure.screen,
|
|
420
437
|
...bodyBoundQueries
|
|
@@ -5,9 +5,9 @@ import { userEvent } from '@testing-library/user-event';
|
|
|
5
5
|
import * as React from 'react';
|
|
6
6
|
import * as ReactDOMServer from 'react-dom/server';
|
|
7
7
|
import { beforeEach, afterEach, beforeAll, vi } from 'vitest';
|
|
8
|
-
import { reactMajor } from "./env.
|
|
9
|
-
import { flushMicrotasks } from "./flushMicrotasks.
|
|
10
|
-
import { config as utilsConfig } from "./configure.
|
|
8
|
+
import { reactMajor } from "./env.mjs";
|
|
9
|
+
import { flushMicrotasks } from "./flushMicrotasks.mjs";
|
|
10
|
+
import { config as utilsConfig } from "./configure.mjs";
|
|
11
11
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
12
|
function queryAllDescriptionsOf(baseElement, element) {
|
|
13
13
|
const ariaDescribedBy = element.getAttribute('aria-describedby');
|
|
@@ -62,6 +62,11 @@ function render(element, configuration) {
|
|
|
62
62
|
},
|
|
63
63
|
setProps(props) {
|
|
64
64
|
testingLibraryRenderResult.rerender(/*#__PURE__*/React.cloneElement(element, props));
|
|
65
|
+
},
|
|
66
|
+
async setPropsAsync(props) {
|
|
67
|
+
await rtlAct(async () => {
|
|
68
|
+
testingLibraryRenderResult.rerender(/*#__PURE__*/React.cloneElement(element, props));
|
|
69
|
+
});
|
|
65
70
|
}
|
|
66
71
|
};
|
|
67
72
|
return result;
|
|
@@ -143,6 +148,11 @@ function createClock(defaultMode, config, options) {
|
|
|
143
148
|
vi.advanceTimersByTime(timeoutMS);
|
|
144
149
|
});
|
|
145
150
|
},
|
|
151
|
+
async tickAsync(timeoutMS) {
|
|
152
|
+
await rtlAct(async () => {
|
|
153
|
+
await vi.advanceTimersByTimeAsync(timeoutMS);
|
|
154
|
+
});
|
|
155
|
+
},
|
|
146
156
|
runAll() {
|
|
147
157
|
rtlAct(() => {
|
|
148
158
|
vi.runAllTimers();
|
|
@@ -355,10 +365,17 @@ export function fireTouchChangedEvent(target, type, options) {
|
|
|
355
365
|
function act(callback) {
|
|
356
366
|
return rtlAct(callback);
|
|
357
367
|
}
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
368
|
+
function createBodyBoundQueries() {
|
|
369
|
+
return within(document.body, {
|
|
370
|
+
...queries,
|
|
371
|
+
...customQueries
|
|
372
|
+
});
|
|
373
|
+
}
|
|
374
|
+
const bodyBoundQueries = typeof document === 'undefined' ? new Proxy({}, {
|
|
375
|
+
get: () => {
|
|
376
|
+
throw new Error('bodyBoundQueries is not available in a non-DOM environment');
|
|
377
|
+
}
|
|
378
|
+
}) : createBodyBoundQueries();
|
|
362
379
|
export { configure, render, renderHook, waitFor, within, cleanup, createEvent
|
|
363
380
|
|
|
364
381
|
// eslint-disable-next-line import/extensions
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { MuiRenderResult } from "./createRenderer.
|
|
2
|
+
import { MuiRenderResult } from "./createRenderer.mjs";
|
|
3
3
|
interface DataProps {
|
|
4
4
|
[key: `data-${string}`]: string;
|
|
5
5
|
}
|
|
@@ -192,5 +192,5 @@ declare const fullSuite: {
|
|
|
192
192
|
themeVariants: typeof testThemeVariants;
|
|
193
193
|
themeCustomPalette: typeof testThemeCustomPalette;
|
|
194
194
|
};
|
|
195
|
-
declare const _default: import("./createDescribe.
|
|
195
|
+
declare const _default: import("./createDescribe.mjs").MUIDescribe<[minimalElement: React.ReactElement<any, string | React.JSXElementConstructor<any>>, getOptions: () => ConformanceOptions]>;
|
|
196
196
|
export default _default;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { expect } from 'chai';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { describe, it, afterAll, afterEach, beforeEach } from 'vitest';
|
|
4
|
-
import createDescribe from "./createDescribe.
|
|
5
|
-
import { isJsdom } from "./env.
|
|
4
|
+
import createDescribe from "./createDescribe.mjs";
|
|
5
|
+
import { isJsdom } from "./env.mjs";
|
|
6
6
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
7
7
|
function capitalize(string) {
|
|
8
8
|
return string.charAt(0).toUpperCase() + string.slice(1);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function ignoreActWarnings(): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function ignoreActWarnings(): void;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.ignoreActWarnings = ignoreActWarnings;
|
|
7
|
+
var _vitest = require("vitest");
|
|
8
|
+
function ignoreActWarnings() {
|
|
9
|
+
const originalConsoleError = console.error;
|
|
10
|
+
console.error = new Proxy(console.error, {
|
|
11
|
+
apply(target, thisArg, args) {
|
|
12
|
+
if (typeof args[0] === 'string' && args[0].includes('An update to %s inside a test was not wrapped in act')) {
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
Reflect.apply(target, thisArg, args);
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
(0, _vitest.onTestFinished)(() => {
|
|
19
|
+
console.error = originalConsoleError;
|
|
20
|
+
});
|
|
21
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { onTestFinished } from 'vitest';
|
|
2
|
+
export function ignoreActWarnings() {
|
|
3
|
+
const originalConsoleError = console.error;
|
|
4
|
+
console.error = new Proxy(console.error, {
|
|
5
|
+
apply(target, thisArg, args) {
|
|
6
|
+
if (typeof args[0] === 'string' && args[0].includes('An update to %s inside a test was not wrapped in act')) {
|
|
7
|
+
return;
|
|
8
|
+
}
|
|
9
|
+
Reflect.apply(target, thisArg, args);
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
onTestFinished(() => {
|
|
13
|
+
console.error = originalConsoleError;
|
|
14
|
+
});
|
|
15
|
+
}
|
package/index.d.mts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import "./initMatchers.mjs";
|
|
2
|
+
export * from "./components.mjs";
|
|
3
|
+
export { default as describeConformance } from "./describeConformance.mjs";
|
|
4
|
+
export * from "./describeConformance.mjs";
|
|
5
|
+
export { default as createDescribe } from "./createDescribe.mjs";
|
|
6
|
+
export * from "./createRenderer.mjs";
|
|
7
|
+
export { default as focusVisible, simulatePointerDevice, simulateKeyboardDevice, programmaticFocusTriggersFocusVisible } from "./focusVisible.mjs";
|
|
8
|
+
export { fireEvent as fireDiscreteEvent } from '@testing-library/react/pure.js';
|
|
9
|
+
export { flushMicrotasks } from "./flushMicrotasks.mjs";
|
|
10
|
+
export * from "./env.mjs";
|
|
11
|
+
export { ignoreActWarnings } from "./ignoreActWarnings.mjs";
|
package/index.d.ts
CHANGED
|
@@ -7,4 +7,5 @@ export * from "./createRenderer.js";
|
|
|
7
7
|
export { default as focusVisible, simulatePointerDevice, simulateKeyboardDevice, programmaticFocusTriggersFocusVisible } from "./focusVisible.js";
|
|
8
8
|
export { fireEvent as fireDiscreteEvent } from '@testing-library/react/pure.js';
|
|
9
9
|
export { flushMicrotasks } from "./flushMicrotasks.js";
|
|
10
|
-
export * from "./env.js";
|
|
10
|
+
export * from "./env.js";
|
|
11
|
+
export { ignoreActWarnings } from "./ignoreActWarnings.js";
|
package/index.js
CHANGED
|
@@ -20,7 +20,8 @@ var _exportNames = {
|
|
|
20
20
|
simulateKeyboardDevice: true,
|
|
21
21
|
programmaticFocusTriggersFocusVisible: true,
|
|
22
22
|
fireDiscreteEvent: true,
|
|
23
|
-
flushMicrotasks: true
|
|
23
|
+
flushMicrotasks: true,
|
|
24
|
+
ignoreActWarnings: true
|
|
24
25
|
};
|
|
25
26
|
Object.defineProperty(exports, "createDescribe", {
|
|
26
27
|
enumerable: true,
|
|
@@ -52,6 +53,12 @@ Object.defineProperty(exports, "focusVisible", {
|
|
|
52
53
|
return _focusVisible.default;
|
|
53
54
|
}
|
|
54
55
|
});
|
|
56
|
+
Object.defineProperty(exports, "ignoreActWarnings", {
|
|
57
|
+
enumerable: true,
|
|
58
|
+
get: function () {
|
|
59
|
+
return _ignoreActWarnings.ignoreActWarnings;
|
|
60
|
+
}
|
|
61
|
+
});
|
|
55
62
|
Object.defineProperty(exports, "programmaticFocusTriggersFocusVisible", {
|
|
56
63
|
enumerable: true,
|
|
57
64
|
get: function () {
|
|
@@ -122,4 +129,5 @@ Object.keys(_env).forEach(function (key) {
|
|
|
122
129
|
return _env[key];
|
|
123
130
|
}
|
|
124
131
|
});
|
|
125
|
-
});
|
|
132
|
+
});
|
|
133
|
+
var _ignoreActWarnings = require("./ignoreActWarnings");
|
|
@@ -5,14 +5,15 @@
|
|
|
5
5
|
* This source code is licensed under the undefined license found in the
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*/
|
|
8
|
-
import "./initMatchers.
|
|
9
|
-
export * from "./components.
|
|
10
|
-
export { default as describeConformance } from "./describeConformance.
|
|
11
|
-
export * from "./describeConformance.
|
|
12
|
-
export { default as createDescribe } from "./createDescribe.
|
|
13
|
-
export * from "./createRenderer.
|
|
14
|
-
export { default as focusVisible, simulatePointerDevice, simulateKeyboardDevice, programmaticFocusTriggersFocusVisible } from "./focusVisible.
|
|
8
|
+
import "./initMatchers.mjs";
|
|
9
|
+
export * from "./components.mjs";
|
|
10
|
+
export { default as describeConformance } from "./describeConformance.mjs";
|
|
11
|
+
export * from "./describeConformance.mjs";
|
|
12
|
+
export { default as createDescribe } from "./createDescribe.mjs";
|
|
13
|
+
export * from "./createRenderer.mjs";
|
|
14
|
+
export { default as focusVisible, simulatePointerDevice, simulateKeyboardDevice, programmaticFocusTriggersFocusVisible } from "./focusVisible.mjs";
|
|
15
15
|
// eslint-disable-next-line import/extensions
|
|
16
16
|
export { fireEvent as fireDiscreteEvent } from '@testing-library/react/pure.js';
|
|
17
|
-
export { flushMicrotasks } from "./flushMicrotasks.
|
|
18
|
-
export * from "./env.
|
|
17
|
+
export { flushMicrotasks } from "./flushMicrotasks.mjs";
|
|
18
|
+
export * from "./env.mjs";
|
|
19
|
+
export { ignoreActWarnings } from "./ignoreActWarnings.mjs";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/internal-test-utils",
|
|
3
|
-
"version": "2.0.18-canary.
|
|
3
|
+
"version": "2.0.18-canary.11",
|
|
4
4
|
"author": "MUI Team",
|
|
5
5
|
"description": "Utilities for MUI tests. This is an internal package not meant for general use.",
|
|
6
6
|
"repository": {
|
|
@@ -10,18 +10,17 @@
|
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@types/chai-dom": "^1.11.3",
|
|
13
|
-
"@babel/runtime": "^7.28.
|
|
13
|
+
"@babel/runtime": "^7.28.6",
|
|
14
14
|
"@testing-library/dom": "^10.4.1",
|
|
15
|
-
"@testing-library/react": "^16.3.
|
|
15
|
+
"@testing-library/react": "^16.3.2",
|
|
16
16
|
"@testing-library/user-event": "^14.6.1",
|
|
17
17
|
"assertion-error": "^2.0.1",
|
|
18
18
|
"chai-dom": "^1.12.1",
|
|
19
19
|
"dom-accessibility-api": "^0.7.1",
|
|
20
|
-
"es-toolkit": "^1.
|
|
20
|
+
"es-toolkit": "^1.44.0",
|
|
21
21
|
"format-util": "^1.0.5",
|
|
22
|
-
"jsdom": "^
|
|
22
|
+
"jsdom": "^27.4.0",
|
|
23
23
|
"prop-types": "^15.8.1",
|
|
24
|
-
"sinon": "^21.0.1",
|
|
25
24
|
"vitest-fail-on-console": "^0.10.1"
|
|
26
25
|
},
|
|
27
26
|
"peerDependencies": {
|
|
@@ -44,91 +43,122 @@
|
|
|
44
43
|
"access": "public"
|
|
45
44
|
},
|
|
46
45
|
"type": "commonjs",
|
|
47
|
-
"main": "./index.js",
|
|
48
|
-
"types": "./index.d.ts",
|
|
49
46
|
"exports": {
|
|
50
47
|
"./package.json": "./package.json",
|
|
51
48
|
".": {
|
|
49
|
+
"import": {
|
|
50
|
+
"types": "./index.d.mts",
|
|
51
|
+
"default": "./index.mjs"
|
|
52
|
+
},
|
|
52
53
|
"require": {
|
|
53
54
|
"types": "./index.d.ts",
|
|
54
55
|
"default": "./index.js"
|
|
55
56
|
},
|
|
56
57
|
"default": {
|
|
57
|
-
"types": "./
|
|
58
|
-
"default": "./
|
|
58
|
+
"types": "./index.d.mts",
|
|
59
|
+
"default": "./index.mjs"
|
|
59
60
|
}
|
|
60
61
|
},
|
|
61
62
|
"./createDescribe": {
|
|
63
|
+
"import": {
|
|
64
|
+
"types": "./createDescribe.d.mts",
|
|
65
|
+
"default": "./createDescribe.mjs"
|
|
66
|
+
},
|
|
62
67
|
"require": {
|
|
63
68
|
"types": "./createDescribe.d.ts",
|
|
64
69
|
"default": "./createDescribe.js"
|
|
65
70
|
},
|
|
66
71
|
"default": {
|
|
67
|
-
"types": "./
|
|
68
|
-
"default": "./
|
|
72
|
+
"types": "./createDescribe.d.mts",
|
|
73
|
+
"default": "./createDescribe.mjs"
|
|
69
74
|
}
|
|
70
75
|
},
|
|
71
76
|
"./createRenderer": {
|
|
77
|
+
"import": {
|
|
78
|
+
"types": "./createRenderer.d.mts",
|
|
79
|
+
"default": "./createRenderer.mjs"
|
|
80
|
+
},
|
|
72
81
|
"require": {
|
|
73
82
|
"types": "./createRenderer.d.ts",
|
|
74
83
|
"default": "./createRenderer.js"
|
|
75
84
|
},
|
|
76
85
|
"default": {
|
|
77
|
-
"types": "./
|
|
78
|
-
"default": "./
|
|
86
|
+
"types": "./createRenderer.d.mts",
|
|
87
|
+
"default": "./createRenderer.mjs"
|
|
79
88
|
}
|
|
80
89
|
},
|
|
81
90
|
"./initMatchers": {
|
|
91
|
+
"import": {
|
|
92
|
+
"types": "./initMatchers.d.mts",
|
|
93
|
+
"default": "./initMatchers.mjs"
|
|
94
|
+
},
|
|
82
95
|
"require": {
|
|
83
96
|
"types": "./initMatchers.d.ts",
|
|
84
97
|
"default": "./initMatchers.js"
|
|
85
98
|
},
|
|
86
99
|
"default": {
|
|
87
|
-
"types": "./
|
|
88
|
-
"default": "./
|
|
100
|
+
"types": "./initMatchers.d.mts",
|
|
101
|
+
"default": "./initMatchers.mjs"
|
|
89
102
|
}
|
|
90
103
|
},
|
|
91
104
|
"./env": {
|
|
105
|
+
"import": {
|
|
106
|
+
"types": "./env.d.mts",
|
|
107
|
+
"default": "./env.mjs"
|
|
108
|
+
},
|
|
92
109
|
"require": {
|
|
93
110
|
"types": "./env.d.ts",
|
|
94
111
|
"default": "./env.js"
|
|
95
112
|
},
|
|
96
113
|
"default": {
|
|
97
|
-
"types": "./
|
|
98
|
-
"default": "./
|
|
114
|
+
"types": "./env.d.mts",
|
|
115
|
+
"default": "./env.mjs"
|
|
99
116
|
}
|
|
100
117
|
},
|
|
101
118
|
"./initPlaywrightMatchers": {
|
|
119
|
+
"import": {
|
|
120
|
+
"types": "./initPlaywrightMatchers.d.mts",
|
|
121
|
+
"default": "./initPlaywrightMatchers.mjs"
|
|
122
|
+
},
|
|
102
123
|
"require": {
|
|
103
124
|
"types": "./initPlaywrightMatchers.d.ts",
|
|
104
125
|
"default": "./initPlaywrightMatchers.js"
|
|
105
126
|
},
|
|
106
127
|
"default": {
|
|
107
|
-
"types": "./
|
|
108
|
-
"default": "./
|
|
128
|
+
"types": "./initPlaywrightMatchers.d.mts",
|
|
129
|
+
"default": "./initPlaywrightMatchers.mjs"
|
|
109
130
|
}
|
|
110
131
|
},
|
|
111
132
|
"./chaiPlugin": {
|
|
133
|
+
"import": {
|
|
134
|
+
"types": "./chaiPlugin.d.mts",
|
|
135
|
+
"default": "./chaiPlugin.mjs"
|
|
136
|
+
},
|
|
112
137
|
"require": {
|
|
113
138
|
"types": "./chaiPlugin.d.ts",
|
|
114
139
|
"default": "./chaiPlugin.js"
|
|
115
140
|
},
|
|
116
141
|
"default": {
|
|
117
|
-
"types": "./
|
|
118
|
-
"default": "./
|
|
142
|
+
"types": "./chaiPlugin.d.mts",
|
|
143
|
+
"default": "./chaiPlugin.mjs"
|
|
119
144
|
}
|
|
120
145
|
},
|
|
121
146
|
"./setupVitest": {
|
|
147
|
+
"import": {
|
|
148
|
+
"types": "./setupVitest.d.mts",
|
|
149
|
+
"default": "./setupVitest.mjs"
|
|
150
|
+
},
|
|
122
151
|
"require": {
|
|
123
152
|
"types": "./setupVitest.d.ts",
|
|
124
153
|
"default": "./setupVitest.js"
|
|
125
154
|
},
|
|
126
155
|
"default": {
|
|
127
|
-
"types": "./
|
|
128
|
-
"default": "./
|
|
156
|
+
"types": "./setupVitest.d.mts",
|
|
157
|
+
"default": "./setupVitest.mjs"
|
|
129
158
|
}
|
|
130
|
-
}
|
|
131
|
-
"./esm": null
|
|
159
|
+
}
|
|
132
160
|
},
|
|
133
|
-
"
|
|
161
|
+
"main": "./index.js",
|
|
162
|
+
"types": "./index.d.ts",
|
|
163
|
+
"gitSha": "bc30ce0e4141eb2f5d6d029cccc5ad0e191ad6f6"
|
|
134
164
|
}
|
package/setupVitest.js
CHANGED
|
@@ -36,15 +36,6 @@ function setupVitest({
|
|
|
36
36
|
_vitest.vi.useRealTimers();
|
|
37
37
|
(0, _pure.cleanup)();
|
|
38
38
|
});
|
|
39
|
-
if (isInitialized) {
|
|
40
|
-
return;
|
|
41
|
-
}
|
|
42
|
-
(0, _configure.configure)(config);
|
|
43
|
-
isInitialized = true;
|
|
44
|
-
|
|
45
|
-
// Don't call test lifecycle hooks after this point
|
|
46
|
-
|
|
47
|
-
chai.use(_chaiPlugin.default);
|
|
48
39
|
if (failOnConsoleEnabled) {
|
|
49
40
|
(0, _vitestFailOnConsole.default)({
|
|
50
41
|
silenceMessage: message => {
|
|
@@ -70,6 +61,17 @@ function setupVitest({
|
|
|
70
61
|
}
|
|
71
62
|
});
|
|
72
63
|
}
|
|
64
|
+
|
|
65
|
+
// Don't call test lifecycle hooks (afterEach/afterAll/beforeEach/beforeAll/...) after this point
|
|
66
|
+
// Make sure none of (transitive) dependencies call lifecycle hooks either, otherwise they won't be
|
|
67
|
+
// registered and thus won't run when using `--no-isolate --no-file-parallelism`.
|
|
68
|
+
|
|
69
|
+
if (isInitialized) {
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
isInitialized = true;
|
|
73
|
+
(0, _configure.configure)(config);
|
|
74
|
+
chai.use(_chaiPlugin.default);
|
|
73
75
|
if (typeof window !== 'undefined') {
|
|
74
76
|
chai.use(_chaiDom.default);
|
|
75
77
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import failOnConsole from 'vitest-fail-on-console';
|
|
2
2
|
import * as chai from 'chai';
|
|
3
|
-
import "./chaiTypes.
|
|
3
|
+
import "./chaiTypes.mjs";
|
|
4
4
|
// eslint-disable-next-line import/extensions
|
|
5
5
|
import { cleanup, act } from '@testing-library/react/pure.js';
|
|
6
6
|
import { afterEach, vi } from 'vitest';
|
|
7
7
|
import chaiDom from 'chai-dom';
|
|
8
|
-
import chaiPlugin from "./chaiPlugin.
|
|
9
|
-
import { configure } from "./configure.
|
|
8
|
+
import chaiPlugin from "./chaiPlugin.mjs";
|
|
9
|
+
import { configure } from "./configure.mjs";
|
|
10
10
|
let isInitialized = false;
|
|
11
11
|
export default function setupVitest({
|
|
12
12
|
failOnConsoleEnabled = true,
|
|
@@ -27,15 +27,6 @@ export default function setupVitest({
|
|
|
27
27
|
vi.useRealTimers();
|
|
28
28
|
cleanup();
|
|
29
29
|
});
|
|
30
|
-
if (isInitialized) {
|
|
31
|
-
return;
|
|
32
|
-
}
|
|
33
|
-
configure(config);
|
|
34
|
-
isInitialized = true;
|
|
35
|
-
|
|
36
|
-
// Don't call test lifecycle hooks after this point
|
|
37
|
-
|
|
38
|
-
chai.use(chaiPlugin);
|
|
39
30
|
if (failOnConsoleEnabled) {
|
|
40
31
|
failOnConsole({
|
|
41
32
|
silenceMessage: message => {
|
|
@@ -61,6 +52,17 @@ export default function setupVitest({
|
|
|
61
52
|
}
|
|
62
53
|
});
|
|
63
54
|
}
|
|
55
|
+
|
|
56
|
+
// Don't call test lifecycle hooks (afterEach/afterAll/beforeEach/beforeAll/...) after this point
|
|
57
|
+
// Make sure none of (transitive) dependencies call lifecycle hooks either, otherwise they won't be
|
|
58
|
+
// registered and thus won't run when using `--no-isolate --no-file-parallelism`.
|
|
59
|
+
|
|
60
|
+
if (isInitialized) {
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
isInitialized = true;
|
|
64
|
+
configure(config);
|
|
65
|
+
chai.use(chaiPlugin);
|
|
64
66
|
if (typeof window !== 'undefined') {
|
|
65
67
|
chai.use(chaiDom);
|
|
66
68
|
|
package/esm/index.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import "./initMatchers.js";
|
|
2
|
-
export * from "./components.js";
|
|
3
|
-
export { default as describeConformance } from "./describeConformance.js";
|
|
4
|
-
export * from "./describeConformance.js";
|
|
5
|
-
export { default as createDescribe } from "./createDescribe.js";
|
|
6
|
-
export * from "./createRenderer.js";
|
|
7
|
-
export { default as focusVisible, simulatePointerDevice, simulateKeyboardDevice, programmaticFocusTriggersFocusVisible } from "./focusVisible.js";
|
|
8
|
-
export { fireEvent as fireDiscreteEvent } from '@testing-library/react/pure.js';
|
|
9
|
-
export { flushMicrotasks } from "./flushMicrotasks.js";
|
|
10
|
-
export * from "./env.js";
|
package/esm/initMatchers.d.ts
DELETED
package/esm/package.json
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"type":"module","sideEffects":false}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/{esm/env.js → env.mjs}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|