Skip to content

Commit

Permalink
feat: update tests to use baseElement
Browse files Browse the repository at this point in the history
  • Loading branch information
bcarroll22 committed Apr 6, 2019
1 parent dba6cd4 commit 41f1b69
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion extend-expect.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
require('./dist/extend-expect')
require('./dist/extend-expect');
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"husky": "^1.3.1",
"jest": "^24.7.1",
"metro-react-native-babel-preset": "^0.52.0",
"native-testing-library": "^1.2.0",
"native-testing-library": "^1.5.0",
"prettier": "^1.16.4",
"pretty-quick": "^1.10.0",
"react": "16.8.3",
Expand Down
14 changes: 7 additions & 7 deletions src/__tests__/to-have-text-content.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ describe('.toHaveTextContent', () => {
});

test('normalizes whitespace by default', () => {
const { rootInstance } = render(
const { baseElement } = render(
<Text>
{`
Step
Expand All @@ -34,7 +34,7 @@ describe('.toHaveTextContent', () => {
</Text>,
);

expect(rootInstance).toHaveTextContent('Step 1 of 4');
expect(baseElement).toHaveTextContent('Step 1 of 4');
});

test('can handle multiple levels', () => {
Expand Down Expand Up @@ -63,14 +63,14 @@ describe('.toHaveTextContent', () => {
});

test('does not throw error with empty content', () => {
const { rootInstance } = render(<Text />);
expect(rootInstance).toHaveTextContent('');
const { baseElement } = render(<Text />);
expect(baseElement).toHaveTextContent('');
});

test('is case-sensitive', () => {
const { rootInstance } = render(<Text>Sensitive text</Text>);
const { baseElement } = render(<Text>Sensitive text</Text>);

expect(rootInstance).toHaveTextContent('Sensitive text');
expect(rootInstance).not.toHaveTextContent('sensitive text');
expect(baseElement).toHaveTextContent('Sensitive text');
expect(baseElement).not.toHaveTextContent('sensitive text');
});
});

0 comments on commit 41f1b69

Please sign in to comment.