Remove usage of legacyRoot in RTL tests (#28485)
* Remove usage of legacyRoot in RTL tests Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Iterate Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Iterate Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Iterate Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Iterate Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --------- Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
parent
d5c111f656
commit
95630f525f
9 changed files with 40 additions and 38 deletions
|
@ -162,8 +162,11 @@ describe("<MatrixChat />", () => {
|
|||
};
|
||||
let initPromise: Promise<void> | undefined;
|
||||
let defaultProps: ComponentProps<typeof MatrixChat>;
|
||||
const getComponent = (props: Partial<ComponentProps<typeof MatrixChat>> = {}) =>
|
||||
render(<MatrixChat {...defaultProps} {...props} />, { legacyRoot: true });
|
||||
const getComponent = (props: Partial<ComponentProps<typeof MatrixChat>> = {}) => {
|
||||
// MatrixChat does many questionable things which bomb tests in modern React mode,
|
||||
// we'll want to refactor and break up MatrixChat before turning off legacyRoot mode
|
||||
return render(<MatrixChat {...defaultProps} {...props} />, { legacyRoot: true });
|
||||
};
|
||||
|
||||
// make test results readable
|
||||
filterConsole(
|
||||
|
@ -1128,7 +1131,7 @@ describe("<MatrixChat />", () => {
|
|||
|
||||
await getComponentAndLogin();
|
||||
|
||||
act(() => bootstrapDeferred.resolve());
|
||||
bootstrapDeferred.resolve();
|
||||
|
||||
await expect(
|
||||
screen.findByRole("heading", { name: "You're in", level: 1 }),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue