addons/isl/integrationTests/commits.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('commits integration test', () => {
b69ab3112 it('shows commits', async () => {
b69ab3113 const {cleanup, drawdag, refresh} = await initRepo();
b69ab3114 await act(() =>
b69ab3115 drawdag(`
b69ab3116 C D
b69ab3117 |/
b69ab3118 B
b69ab3119 |
b69ab3120 A
b69ab3121 `),
b69ab3122 );
b69ab3123 refresh();
b69ab3124
b69ab3125 // commits should show up in the commit tree
b69ab3126 await waitFor(() => within(screen.getByTestId('commit-tree-root')).getByText('A'));
b69ab3127 await waitFor(() => within(screen.getByTestId('commit-tree-root')).getByText('B'));
b69ab3128 await waitFor(() => within(screen.getByTestId('commit-tree-root')).getByText('C'));
b69ab3129 await waitFor(() => within(screen.getByTestId('commit-tree-root')).getByText('D'));
b69ab3130
b69ab3131 await act(cleanup);
b69ab3132 });
b69ab3133});