Skip to content

Commit

Permalink
Remove test for invalid behaviour
Browse files Browse the repository at this point in the history
  • Loading branch information
danreeves committed Jun 7, 2022
1 parent 516fbdc commit 9509d54
Showing 1 changed file with 0 additions and 29 deletions.
29 changes: 0 additions & 29 deletions test/trans.render.object.spec.js
Expand Up @@ -242,32 +242,3 @@ describe('trans using no children but components (object) - interpolated compone
`);
});
});

describe('trans using no children but components (object) - ReactNodes that error', () => {
const Button = ({ children }) => <button type="button">{children}</button>;
// Suppress console.errors in these tests
let consoleErrorFn;
beforeAll(() => {
consoleErrorFn = jest.spyOn(console, 'error').mockImplementation(() => jest.fn());
});
afterAll(() => {
consoleErrorFn.restoreMocks();
});
it('should throw if you use some valid ReactNodes', () => {
expect(() =>
render(<Trans defaults="hello <ClickMe>Test</ClickMe>" components={{ ClickMe: Button }} />),
).toThrow();

expect(() =>
render(<Trans defaults="hello <ClickMe>Test</ClickMe>" components={{ ClickMe: {} }} />),
).toThrow();

expect(() =>
render(<Trans defaults="hello <ClickMe>Test</ClickMe>" components={{ ClickMe: null }} />),
).toThrow();

expect(() =>
render(<Trans defaults="hello <ClickMe>Test</ClickMe>" components={{ ClickMe: true }} />),
).toThrow();
});
});

0 comments on commit 9509d54

Please sign in to comment.