| 1 | /** |
| 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. |
| 3 | * |
| 4 | * This source code is licensed under the MIT license found in the |
| 5 | * LICENSE file in the root directory of this source tree. |
| 6 | */ |
| 7 | |
| 8 | import {act, screen, waitFor, within} from '@testing-library/react'; |
| 9 | import {initRepo} from './setup'; |
| 10 | |
| 11 | describe('commits integration test', () => { |
| 12 | it('shows commits', async () => { |
| 13 | const {cleanup, drawdag, refresh} = await initRepo(); |
| 14 | await act(() => |
| 15 | drawdag(` |
| 16 | C D |
| 17 | |/ |
| 18 | B |
| 19 | | |
| 20 | A |
| 21 | `), |
| 22 | ); |
| 23 | refresh(); |
| 24 | |
| 25 | // commits should show up in the commit tree |
| 26 | await waitFor(() => within(screen.getByTestId('commit-tree-root')).getByText('A')); |
| 27 | await waitFor(() => within(screen.getByTestId('commit-tree-root')).getByText('B')); |
| 28 | await waitFor(() => within(screen.getByTestId('commit-tree-root')).getByText('C')); |
| 29 | await waitFor(() => within(screen.getByTestId('commit-tree-root')).getByText('D')); |
| 30 | |
| 31 | await act(cleanup); |
| 32 | }); |
| 33 | }); |
| 34 | |