You've already forked element-web
mirror of
https://github.com/element-hq/element-web.git
synced 2025-08-09 14:42:51 +03:00
Switch secondary React trees to the createRoot API (#28296)
* Switch secondary React trees to the createRoot API 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> * Add comment Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --------- Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
committed by
GitHub
parent
2f8e98242c
commit
d06cf09bf0
@@ -7,6 +7,7 @@ Please see LICENSE files in the repository root for full details.
|
||||
*/
|
||||
|
||||
import EventEmitter from "events";
|
||||
import { act } from "jest-matrix-react";
|
||||
|
||||
import { ActionPayload } from "../../src/dispatcher/payloads";
|
||||
import defaultDispatcher from "../../src/dispatcher/dispatcher";
|
||||
@@ -119,7 +120,7 @@ export function untilEmission(
|
||||
});
|
||||
}
|
||||
|
||||
export const flushPromises = async () => await new Promise<void>((resolve) => window.setTimeout(resolve));
|
||||
export const flushPromises = () => act(async () => await new Promise<void>((resolve) => window.setTimeout(resolve)));
|
||||
|
||||
// with jest's modern fake timers process.nextTick is also mocked,
|
||||
// flushing promises in the normal way then waits for some advancement
|
||||
|
Reference in New Issue
Block a user