Skip to content

Commit 964b58b

Browse files
Venkataramanan VenkateswaranVenkataramanan Venkateswaran
authored andcommitted
Venkataramanan fix: Countdown formatting
1 parent 496df81 commit 964b58b

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

src/components/Timer/__test__/Countdown.test.jsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,11 @@ describe('Countdown Component', () => {
3636
expect(screen.getByText('Goal: 01:00:00')).toBeInTheDocument();
3737
expect(screen.getByText('Elapsed: 00:30:00')).toBeInTheDocument();
3838
expect(screen.getByText('Time Remaining')).toBeInTheDocument();
39-
expect(screen.getByText('00')).toBeInTheDocument();
39+
expect(screen.getAllByText('00')).toHaveLength(2);
4040
expect(screen.getByText('30')).toBeInTheDocument();
41+
expect(screen.getByText('Hours')).toBeInTheDocument();
42+
expect(screen.getByText('minutes')).toBeInTheDocument();
43+
expect(screen.getByText('seconds')).toBeInTheDocument();
4144
});
4245

4346
it('calls toggleTimer when the close button is clicked', () => {
@@ -51,9 +54,8 @@ describe('Countdown Component', () => {
5154
it('displays correct remaining time based on props', () => {
5255
// eslint-disable-next-line react/jsx-props-no-spreading
5356
const { rerender } = render(<Countdown {...defaultProps} />);
54-
expect(screen.getByText('00')).toBeInTheDocument(); // Hours
57+
expect(screen.getAllByText('00')).toHaveLength(2); // Hours and Seconds
5558
expect(screen.getByText('30')).toBeInTheDocument(); // Minutes
56-
expect(screen.getByText('00')).toBeInTheDocument(); // Seconds
5759

5860
rerender(
5961
<Countdown

0 commit comments

Comments
 (0)