| 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('uncommitted changes integration test', () => { |
| 12 | it('shows changed file', async () => { |
| 13 | const {cleanup, writeFileInRepo} = await initRepo(); |
| 14 | const {ignoreRTL} = await import('../src/testQueries'); |
| 15 | await act(async () => { |
| 16 | await writeFileInRepo('file.txt', 'hello, world!'); |
| 17 | }); |
| 18 | |
| 19 | // changed file should appear as uncommitted change |
| 20 | await waitFor(() => |
| 21 | within(screen.getByTestId('commit-tree-root')).getByText(ignoreRTL('file.txt')), |
| 22 | ); |
| 23 | |
| 24 | await act(cleanup); |
| 25 | }); |
| 26 | }); |
| 27 | |