Skip to content

Commit f9f1dfb

Browse files
committed
Fix failing test
1 parent f6677cb commit f9f1dfb

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/components/HelloWorld.edge-cases.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { HelloWorld } from './HelloWorld';
66
describe('HelloWorld edge cases', () => {
77
it('respects empty string (no defaulting)', () => {
88
render(<HelloWorld who="" />);
9-
expect(screen.getByText('Hello ')).toBeInTheDocument();
9+
expect(screen.getByText(/^Hello\s*$/)).toBeInTheDocument();
1010
});
1111

1212
it('renders falsy-but-defined values', () => {

src/components/HelloWorld.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,5 @@ export type HelloWorldProps = {
1717
*/
1818
export function HelloWorld({ who = 'World' }: HelloWorldProps): JSX.Element {
1919
return <div>Hello {who}</div>;
20-
}
20+
}
21+

0 commit comments

Comments
 (0)