We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f6677cb commit f9f1dfbCopy full SHA for f9f1dfb
src/components/HelloWorld.edge-cases.test.tsx
@@ -6,7 +6,7 @@ import { HelloWorld } from './HelloWorld';
6
describe('HelloWorld edge cases', () => {
7
it('respects empty string (no defaulting)', () => {
8
render(<HelloWorld who="" />);
9
- expect(screen.getByText('Hello ')).toBeInTheDocument();
+ expect(screen.getByText(/^Hello\s*$/)).toBeInTheDocument();
10
});
11
12
it('renders falsy-but-defined values', () => {
src/components/HelloWorld.tsx
@@ -17,4 +17,5 @@ export type HelloWorldProps = {
17
*/
18
export function HelloWorld({ who = 'World' }: HelloWorldProps): JSX.Element {
19
return <div>Hello {who}</div>;
20
-}
+}
21
+
0 commit comments