You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-08-07 21:23:00 +03:00
Update tests to prefer RTL over Enzyme (#10247
* Update tests to prefer RTL over Enzyme * Strict types
This commit is contained in:
committed by
GitHub
parent
dd6fc124d7
commit
f40d15388c
@@ -14,8 +14,6 @@ See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// eslint-disable-next-line deprecate/import
|
||||
import { ReactWrapper } from "enzyme";
|
||||
import EventEmitter from "events";
|
||||
|
||||
import { ActionPayload } from "../../src/dispatcher/payloads";
|
||||
@@ -128,17 +126,6 @@ export function untilEmission(
|
||||
});
|
||||
}
|
||||
|
||||
export const findByAttr = (attr: string) => (component: ReactWrapper, value: string) =>
|
||||
component.find(`[${attr}="${value}"]`);
|
||||
export const findByTestId = findByAttr("data-test-id");
|
||||
export const findById = findByAttr("id");
|
||||
export const findByAriaLabel = findByAttr("aria-label");
|
||||
|
||||
const findByTagAndAttr = (attr: string) => (component: ReactWrapper, value: string, tag: string) =>
|
||||
component.find(`${tag}[${attr}="${value}"]`);
|
||||
|
||||
export const findByTagAndTestId = findByTagAndAttr("data-test-id");
|
||||
|
||||
export const flushPromises = async () => await new Promise((resolve) => window.setTimeout(resolve));
|
||||
|
||||
// with jest's modern fake timers process.nextTick is also mocked,
|
||||
|
Reference in New Issue
Block a user