addons/isl/integrationTests/uncommittedChanges.test.tsxblame
View source
b69ab311/**
b69ab312 * Copyright (c) Meta Platforms, Inc. and affiliates.
b69ab313 *
b69ab314 * This source code is licensed under the MIT license found in the
b69ab315 * LICENSE file in the root directory of this source tree.
b69ab316 */
b69ab317
b69ab318import {act, screen, waitFor, within} from '@testing-library/react';
b69ab319import {initRepo} from './setup';
b69ab3110
b69ab3111describe('uncommitted changes integration test', () => {
b69ab3112 it('shows changed file', async () => {
b69ab3113 const {cleanup, writeFileInRepo} = await initRepo();
b69ab3114 const {ignoreRTL} = await import('../src/testQueries');
b69ab3115 await act(async () => {
b69ab3116 await writeFileInRepo('file.txt', 'hello, world!');
b69ab3117 });
b69ab3118
b69ab3119 // changed file should appear as uncommitted change
b69ab3120 await waitFor(() =>
b69ab3121 within(screen.getByTestId('commit-tree-root')).getByText(ignoreRTL('file.txt')),
b69ab3122 );
b69ab3123
b69ab3124 await act(cleanup);
b69ab3125 });
b69ab3126});