Skip to content

Commit e8d657c

Browse files
kdquistanchalaSbsCruz
authored andcommitted
feat(native): Add toBeEmptyElement (#142)
1 parent 81bbbf5 commit e8d657c

2 files changed

Lines changed: 16 additions & 0 deletions

File tree

packages/native/src/lib/ElementAssertion.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { Assertion, AssertionError } from "@assertive-ts/core";
22
import { get } from "dot-prop-immutable";
3+
import { Children } from "react";
34
import { ReactTestInstance } from "react-test-renderer";
45

56
import { isAncestorDisabled, isElementDisabled, isAncestorNotVisible, isElementVisible } from "./helpers/accesibility";
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { ReactTestInstance } from "react-test-renderer";
2+
3+
/**
4+
* Converts a ReactTestInstance to a string representation.
5+
*
6+
* @param instance The ReactTestInstance to convert.
7+
* @returns A string representation of the instance.
8+
*/
9+
export function instanceToString(instance: ReactTestInstance | null): string {
10+
if (instance === null) {
11+
return "null";
12+
}
13+
14+
return `<${instance.type.toString()} ... />`;
15+
}

0 commit comments

Comments
 (0)