| b69ab31 | | | 1 | /** |
| b69ab31 | | | 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. |
| b69ab31 | | | 3 | * |
| b69ab31 | | | 4 | * This source code is licensed under the MIT license found in the |
| b69ab31 | | | 5 | * LICENSE file in the root directory of this source tree. |
| b69ab31 | | | 6 | */ |
| b69ab31 | | | 7 | |
| b69ab31 | | | 8 | import {act, fireEvent, render, screen, within} from '@testing-library/react'; |
| b69ab31 | | | 9 | import {nextTick} from 'shared/testUtils'; |
| b69ab31 | | | 10 | import App from '../../App'; |
| b69ab31 | | | 11 | import platform from '../../platform'; |
| b69ab31 | | | 12 | import {CommitInfoTestUtils, CommitTreeListTestUtils, ignoreRTL} from '../../testQueries'; |
| b69ab31 | | | 13 | import { |
| b69ab31 | | | 14 | COMMIT, |
| b69ab31 | | | 15 | expectMessageNOTSentToServer, |
| b69ab31 | | | 16 | expectMessageSentToServer, |
| b69ab31 | | | 17 | resetTestMessages, |
| b69ab31 | | | 18 | simulateCommits, |
| b69ab31 | | | 19 | simulateUncommittedChangedFiles, |
| b69ab31 | | | 20 | } from '../../testUtils'; |
| b69ab31 | | | 21 | import {CommandRunner} from '../../types'; |
| b69ab31 | | | 22 | |
| b69ab31 | | | 23 | /* eslint-disable require-await */ |
| b69ab31 | | | 24 | |
| b69ab31 | | | 25 | describe('RevertOperation', () => { |
| b69ab31 | | | 26 | beforeEach(() => { |
| b69ab31 | | | 27 | resetTestMessages(); |
| b69ab31 | | | 28 | render(<App />); |
| b69ab31 | | | 29 | act(() => { |
| b69ab31 | | | 30 | expectMessageSentToServer({ |
| b69ab31 | | | 31 | type: 'subscribe', |
| b69ab31 | | | 32 | kind: 'smartlogCommits', |
| b69ab31 | | | 33 | subscriptionID: expect.anything(), |
| b69ab31 | | | 34 | }); |
| b69ab31 | | | 35 | simulateCommits({ |
| b69ab31 | | | 36 | value: [ |
| b69ab31 | | | 37 | COMMIT('c', 'Commit C', 'b', { |
| b69ab31 | | | 38 | filePathsSample: ['file.txt'], |
| b69ab31 | | | 39 | totalFileCount: 1, |
| b69ab31 | | | 40 | isDot: true, |
| b69ab31 | | | 41 | }), |
| b69ab31 | | | 42 | COMMIT('b', 'Commit B', 'a', {filePathsSample: ['file.txt'], totalFileCount: 1}), |
| b69ab31 | | | 43 | COMMIT('a', 'Commit A', '1', {filePathsSample: ['file.txt'], totalFileCount: 1}), |
| b69ab31 | | | 44 | COMMIT('1', 'Commit 1', '0', {phase: 'public'}), |
| b69ab31 | | | 45 | ], |
| b69ab31 | | | 46 | }); |
| b69ab31 | | | 47 | }); |
| b69ab31 | | | 48 | |
| b69ab31 | | | 49 | // confirm all prompts about reverting files |
| b69ab31 | | | 50 | jest.spyOn(platform, 'confirm').mockImplementation(() => Promise.resolve(true)); |
| b69ab31 | | | 51 | }); |
| b69ab31 | | | 52 | |
| b69ab31 | | | 53 | const clickRevert = async (inside: HTMLElement, fileName: string) => { |
| b69ab31 | | | 54 | await act(async () => { |
| b69ab31 | | | 55 | const revertButton = within( |
| b69ab31 | | | 56 | within(inside).getByTestId(`changed-file-${fileName}`), |
| b69ab31 | | | 57 | ).getByTestId('file-revert-button'); |
| b69ab31 | | | 58 | expect(revertButton).toBeInTheDocument(); |
| b69ab31 | | | 59 | fireEvent.click(revertButton); |
| b69ab31 | | | 60 | // confirm modal takes 1 tick to resolve |
| b69ab31 | | | 61 | await nextTick(); |
| b69ab31 | | | 62 | }); |
| b69ab31 | | | 63 | }; |
| b69ab31 | | | 64 | |
| b69ab31 | | | 65 | const clickDelete = async (inside: HTMLElement, fileName: string) => { |
| b69ab31 | | | 66 | await act(async () => { |
| b69ab31 | | | 67 | const revertButton = within( |
| b69ab31 | | | 68 | within(inside).getByTestId(`changed-file-${fileName}`), |
| b69ab31 | | | 69 | ).getByTestId('file-action-delete'); |
| b69ab31 | | | 70 | expect(revertButton).toBeInTheDocument(); |
| b69ab31 | | | 71 | fireEvent.click(revertButton); |
| b69ab31 | | | 72 | // confirm modal takes 1 tick to resolve |
| b69ab31 | | | 73 | await nextTick(); |
| b69ab31 | | | 74 | }); |
| b69ab31 | | | 75 | }; |
| b69ab31 | | | 76 | |
| b69ab31 | | | 77 | const clickCheckboxForFile = async (inside: HTMLElement, fileName: string) => { |
| b69ab31 | | | 78 | await act(async () => { |
| b69ab31 | | | 79 | const checkbox = within(within(inside).getByTestId(`changed-file-${fileName}`)).getByTestId( |
| b69ab31 | | | 80 | 'file-selection-checkbox', |
| b69ab31 | | | 81 | ); |
| b69ab31 | | | 82 | expect(checkbox).toBeInTheDocument(); |
| b69ab31 | | | 83 | fireEvent.click(checkbox); |
| b69ab31 | | | 84 | }); |
| b69ab31 | | | 85 | }; |
| b69ab31 | | | 86 | |
| b69ab31 | | | 87 | describe('from uncommitted changes', () => { |
| b69ab31 | | | 88 | beforeEach(() => { |
| b69ab31 | | | 89 | act(() => { |
| b69ab31 | | | 90 | simulateUncommittedChangedFiles({ |
| b69ab31 | | | 91 | value: [ |
| b69ab31 | | | 92 | {path: 'myFile1.txt', status: 'M'}, |
| b69ab31 | | | 93 | {path: 'myFile2.txt', status: 'M'}, |
| b69ab31 | | | 94 | ], |
| b69ab31 | | | 95 | }); |
| b69ab31 | | | 96 | }); |
| b69ab31 | | | 97 | }); |
| b69ab31 | | | 98 | |
| b69ab31 | | | 99 | it('runs revert from uncommitted changes', async () => { |
| b69ab31 | | | 100 | await clickRevert(screen.getByTestId('commit-tree-root'), 'myFile1.txt'); |
| b69ab31 | | | 101 | |
| b69ab31 | | | 102 | expectMessageSentToServer({ |
| b69ab31 | | | 103 | type: 'runOperation', |
| b69ab31 | | | 104 | operation: { |
| b69ab31 | | | 105 | args: ['revert', {type: 'repo-relative-file-list', paths: ['myFile1.txt']}], |
| b69ab31 | | | 106 | id: expect.anything(), |
| b69ab31 | | | 107 | runner: CommandRunner.Sapling, |
| b69ab31 | | | 108 | trackEventName: 'RevertOperation', |
| b69ab31 | | | 109 | }, |
| b69ab31 | | | 110 | }); |
| b69ab31 | | | 111 | }); |
| b69ab31 | | | 112 | |
| b69ab31 | | | 113 | it('renders optimistic state while running revert', async () => { |
| b69ab31 | | | 114 | expect( |
| b69ab31 | | | 115 | CommitTreeListTestUtils.withinCommitTree().getByText(ignoreRTL('myFile1.txt')), |
| b69ab31 | | | 116 | ).toBeInTheDocument(); |
| b69ab31 | | | 117 | await clickRevert(screen.getByTestId('commit-tree-root'), 'myFile1.txt'); |
| b69ab31 | | | 118 | expect( |
| b69ab31 | | | 119 | CommitTreeListTestUtils.withinCommitTree().queryByText(ignoreRTL('myFile1.txt')), |
| b69ab31 | | | 120 | ).not.toBeInTheDocument(); |
| b69ab31 | | | 121 | }); |
| b69ab31 | | | 122 | |
| b69ab31 | | | 123 | describe('untracked files get purged', () => { |
| b69ab31 | | | 124 | beforeEach(() => { |
| b69ab31 | | | 125 | act(() => { |
| b69ab31 | | | 126 | simulateUncommittedChangedFiles({ |
| b69ab31 | | | 127 | value: [ |
| b69ab31 | | | 128 | {path: 'myFile1.txt', status: 'M'}, |
| b69ab31 | | | 129 | {path: 'untracked.txt', status: '?'}, |
| b69ab31 | | | 130 | ], |
| b69ab31 | | | 131 | }); |
| b69ab31 | | | 132 | }); |
| b69ab31 | | | 133 | }); |
| b69ab31 | | | 134 | |
| b69ab31 | | | 135 | it('runs purge for untracked uncommitted changes', async () => { |
| b69ab31 | | | 136 | await clickDelete(screen.getByTestId('commit-tree-root'), 'untracked.txt'); |
| b69ab31 | | | 137 | |
| b69ab31 | | | 138 | expectMessageSentToServer({ |
| b69ab31 | | | 139 | type: 'runOperation', |
| b69ab31 | | | 140 | operation: { |
| b69ab31 | | | 141 | args: [ |
| b69ab31 | | | 142 | 'purge', |
| b69ab31 | | | 143 | '--files', |
| b69ab31 | | | 144 | '--abort-on-err', |
| b69ab31 | | | 145 | {type: 'repo-relative-file-list', paths: ['untracked.txt']}, |
| b69ab31 | | | 146 | ], |
| b69ab31 | | | 147 | id: expect.anything(), |
| b69ab31 | | | 148 | runner: CommandRunner.Sapling, |
| b69ab31 | | | 149 | trackEventName: 'PurgeOperation', |
| b69ab31 | | | 150 | }, |
| b69ab31 | | | 151 | }); |
| b69ab31 | | | 152 | }); |
| b69ab31 | | | 153 | |
| b69ab31 | | | 154 | it('renders optimistic state while running purge', async () => { |
| b69ab31 | | | 155 | expect( |
| b69ab31 | | | 156 | CommitTreeListTestUtils.withinCommitTree().getByText(ignoreRTL('untracked.txt')), |
| b69ab31 | | | 157 | ).toBeInTheDocument(); |
| b69ab31 | | | 158 | await clickDelete(screen.getByTestId('commit-tree-root'), 'untracked.txt'); |
| b69ab31 | | | 159 | expect( |
| b69ab31 | | | 160 | CommitTreeListTestUtils.withinCommitTree().queryByText(ignoreRTL('untracked.txt')), |
| b69ab31 | | | 161 | ).not.toBeInTheDocument(); |
| b69ab31 | | | 162 | }); |
| b69ab31 | | | 163 | }); |
| b69ab31 | | | 164 | }); |
| b69ab31 | | | 165 | |
| b69ab31 | | | 166 | describe('bulk discard', () => { |
| b69ab31 | | | 167 | let confirmSpy: jest.SpyInstance; |
| b69ab31 | | | 168 | beforeEach(() => { |
| b69ab31 | | | 169 | confirmSpy = jest.spyOn(platform, 'confirm').mockImplementation(() => Promise.resolve(true)); |
| b69ab31 | | | 170 | act(() => { |
| b69ab31 | | | 171 | simulateUncommittedChangedFiles({ |
| b69ab31 | | | 172 | value: [ |
| b69ab31 | | | 173 | {path: 'myFile1.txt', status: 'M'}, |
| b69ab31 | | | 174 | {path: 'myFile2.txt', status: 'M'}, |
| b69ab31 | | | 175 | {path: 'untracked1.txt', status: '?'}, |
| b69ab31 | | | 176 | {path: 'untracked2.txt', status: '?'}, |
| b69ab31 | | | 177 | ], |
| b69ab31 | | | 178 | }); |
| b69ab31 | | | 179 | }); |
| b69ab31 | | | 180 | }); |
| b69ab31 | | | 181 | |
| b69ab31 | | | 182 | it('discards all changes with goto --clean if everything selected', async () => { |
| b69ab31 | | | 183 | await act(async () => { |
| b69ab31 | | | 184 | fireEvent.click( |
| b69ab31 | | | 185 | within(screen.getByTestId('commit-tree-root')).getByTestId('discard-all-selected-button'), |
| b69ab31 | | | 186 | ); |
| b69ab31 | | | 187 | }); |
| b69ab31 | | | 188 | |
| b69ab31 | | | 189 | expectMessageSentToServer({ |
| b69ab31 | | | 190 | type: 'runOperation', |
| b69ab31 | | | 191 | operation: { |
| b69ab31 | | | 192 | args: ['goto', '--clean', '.'], |
| b69ab31 | | | 193 | id: expect.anything(), |
| b69ab31 | | | 194 | runner: CommandRunner.Sapling, |
| b69ab31 | | | 195 | trackEventName: 'DiscardOperation', |
| b69ab31 | | | 196 | }, |
| b69ab31 | | | 197 | }); |
| b69ab31 | | | 198 | |
| b69ab31 | | | 199 | expectMessageSentToServer({ |
| b69ab31 | | | 200 | type: 'runOperation', |
| b69ab31 | | | 201 | operation: { |
| b69ab31 | | | 202 | args: ['purge', '--files', '--abort-on-err'], |
| b69ab31 | | | 203 | id: expect.anything(), |
| b69ab31 | | | 204 | runner: CommandRunner.Sapling, |
| b69ab31 | | | 205 | trackEventName: 'PurgeOperation', |
| b69ab31 | | | 206 | }, |
| b69ab31 | | | 207 | }); |
| b69ab31 | | | 208 | |
| b69ab31 | | | 209 | expect(confirmSpy).toHaveBeenCalled(); |
| b69ab31 | | | 210 | }); |
| b69ab31 | | | 211 | |
| b69ab31 | | | 212 | it('discards selected changes with revert and purge', async () => { |
| b69ab31 | | | 213 | const commitTree = screen.getByTestId('commit-tree-root'); |
| b69ab31 | | | 214 | await clickCheckboxForFile(commitTree, 'myFile1.txt'); |
| b69ab31 | | | 215 | await clickCheckboxForFile(commitTree, 'untracked1.txt'); |
| b69ab31 | | | 216 | |
| b69ab31 | | | 217 | await act(async () => { |
| b69ab31 | | | 218 | fireEvent.click( |
| b69ab31 | | | 219 | within(screen.getByTestId('commit-tree-root')).getByTestId('discard-all-selected-button'), |
| b69ab31 | | | 220 | ); |
| b69ab31 | | | 221 | }); |
| b69ab31 | | | 222 | |
| b69ab31 | | | 223 | expectMessageSentToServer({ |
| b69ab31 | | | 224 | type: 'runOperation', |
| b69ab31 | | | 225 | operation: { |
| b69ab31 | | | 226 | args: ['revert', {type: 'repo-relative-file-list', paths: ['myFile2.txt']}], |
| b69ab31 | | | 227 | id: expect.anything(), |
| b69ab31 | | | 228 | runner: CommandRunner.Sapling, |
| b69ab31 | | | 229 | trackEventName: 'RevertOperation', |
| b69ab31 | | | 230 | }, |
| b69ab31 | | | 231 | }); |
| b69ab31 | | | 232 | |
| b69ab31 | | | 233 | expectMessageSentToServer({ |
| b69ab31 | | | 234 | type: 'runOperation', |
| b69ab31 | | | 235 | operation: { |
| b69ab31 | | | 236 | args: [ |
| b69ab31 | | | 237 | 'purge', |
| b69ab31 | | | 238 | '--files', |
| b69ab31 | | | 239 | '--abort-on-err', |
| b69ab31 | | | 240 | {type: 'repo-relative-file-list', paths: ['untracked2.txt']}, |
| b69ab31 | | | 241 | ], |
| b69ab31 | | | 242 | id: expect.anything(), |
| b69ab31 | | | 243 | runner: CommandRunner.Sapling, |
| b69ab31 | | | 244 | trackEventName: 'PurgeOperation', |
| b69ab31 | | | 245 | }, |
| b69ab31 | | | 246 | }); |
| b69ab31 | | | 247 | |
| b69ab31 | | | 248 | expect(confirmSpy).toHaveBeenCalled(); |
| b69ab31 | | | 249 | }); |
| b69ab31 | | | 250 | |
| b69ab31 | | | 251 | it('uses purge for added and renamed files for selected changes', async () => { |
| b69ab31 | | | 252 | act(() => { |
| b69ab31 | | | 253 | simulateUncommittedChangedFiles({ |
| b69ab31 | | | 254 | value: [ |
| b69ab31 | | | 255 | {path: 'myFile1.txt', status: 'A'}, |
| b69ab31 | | | 256 | {path: 'myFile2.txt', status: 'A'}, |
| b69ab31 | | | 257 | {path: 'movedFrom.txt', status: 'R'}, |
| b69ab31 | | | 258 | {path: 'movedTo.txt', status: 'A', copy: 'movedFrom.txt'}, |
| b69ab31 | | | 259 | ], |
| b69ab31 | | | 260 | }); |
| b69ab31 | | | 261 | }); |
| b69ab31 | | | 262 | const commitTree = screen.getByTestId('commit-tree-root'); |
| b69ab31 | | | 263 | await clickCheckboxForFile(commitTree, 'myFile2.txt'); |
| b69ab31 | | | 264 | |
| b69ab31 | | | 265 | await act(async () => { |
| b69ab31 | | | 266 | fireEvent.click( |
| b69ab31 | | | 267 | within(screen.getByTestId('commit-tree-root')).getByTestId('discard-all-selected-button'), |
| b69ab31 | | | 268 | ); |
| b69ab31 | | | 269 | }); |
| b69ab31 | | | 270 | |
| b69ab31 | | | 271 | expectMessageSentToServer({ |
| b69ab31 | | | 272 | type: 'runOperation', |
| b69ab31 | | | 273 | operation: { |
| b69ab31 | | | 274 | args: [ |
| b69ab31 | | | 275 | 'revert', |
| b69ab31 | | | 276 | { |
| b69ab31 | | | 277 | type: 'repo-relative-file-list', |
| b69ab31 | | | 278 | paths: ['myFile1.txt', 'movedFrom.txt', 'movedTo.txt'], |
| b69ab31 | | | 279 | }, |
| b69ab31 | | | 280 | ], |
| b69ab31 | | | 281 | id: expect.anything(), |
| b69ab31 | | | 282 | runner: CommandRunner.Sapling, |
| b69ab31 | | | 283 | trackEventName: 'RevertOperation', |
| b69ab31 | | | 284 | }, |
| b69ab31 | | | 285 | }); |
| b69ab31 | | | 286 | |
| b69ab31 | | | 287 | expectMessageSentToServer({ |
| b69ab31 | | | 288 | type: 'runOperation', |
| b69ab31 | | | 289 | operation: { |
| b69ab31 | | | 290 | args: [ |
| b69ab31 | | | 291 | 'purge', |
| b69ab31 | | | 292 | '--files', |
| b69ab31 | | | 293 | '--abort-on-err', |
| b69ab31 | | | 294 | {type: 'repo-relative-file-list', paths: ['myFile1.txt', 'movedTo.txt']}, |
| b69ab31 | | | 295 | ], |
| b69ab31 | | | 296 | id: expect.anything(), |
| b69ab31 | | | 297 | runner: CommandRunner.Sapling, |
| b69ab31 | | | 298 | trackEventName: 'PurgeOperation', |
| b69ab31 | | | 299 | }, |
| b69ab31 | | | 300 | }); |
| b69ab31 | | | 301 | |
| b69ab31 | | | 302 | expect(confirmSpy).toHaveBeenCalled(); |
| b69ab31 | | | 303 | }); |
| b69ab31 | | | 304 | |
| b69ab31 | | | 305 | it('no need to run purge if no files are untracked', async () => { |
| b69ab31 | | | 306 | const commitTree = screen.getByTestId('commit-tree-root'); |
| b69ab31 | | | 307 | await clickCheckboxForFile(commitTree, 'untracked1.txt'); |
| b69ab31 | | | 308 | await clickCheckboxForFile(commitTree, 'untracked2.txt'); |
| b69ab31 | | | 309 | |
| b69ab31 | | | 310 | await act(async () => { |
| b69ab31 | | | 311 | fireEvent.click( |
| b69ab31 | | | 312 | within(screen.getByTestId('commit-tree-root')).getByTestId('discard-all-selected-button'), |
| b69ab31 | | | 313 | ); |
| b69ab31 | | | 314 | }); |
| b69ab31 | | | 315 | |
| b69ab31 | | | 316 | expectMessageSentToServer({ |
| b69ab31 | | | 317 | type: 'runOperation', |
| b69ab31 | | | 318 | operation: { |
| b69ab31 | | | 319 | args: [ |
| b69ab31 | | | 320 | 'revert', |
| b69ab31 | | | 321 | {type: 'repo-relative-file-list', paths: ['myFile1.txt', 'myFile2.txt']}, |
| b69ab31 | | | 322 | ], |
| b69ab31 | | | 323 | id: expect.anything(), |
| b69ab31 | | | 324 | runner: CommandRunner.Sapling, |
| b69ab31 | | | 325 | trackEventName: 'RevertOperation', |
| b69ab31 | | | 326 | }, |
| b69ab31 | | | 327 | }); |
| b69ab31 | | | 328 | |
| b69ab31 | | | 329 | expectMessageNOTSentToServer({ |
| b69ab31 | | | 330 | type: 'runOperation', |
| b69ab31 | | | 331 | operation: { |
| b69ab31 | | | 332 | args: expect.arrayContaining(['purge', '--files']), |
| b69ab31 | | | 333 | id: expect.anything(), |
| b69ab31 | | | 334 | runner: CommandRunner.Sapling, |
| b69ab31 | | | 335 | trackEventName: expect.anything(), |
| b69ab31 | | | 336 | }, |
| b69ab31 | | | 337 | }); |
| b69ab31 | | | 338 | |
| b69ab31 | | | 339 | expect(confirmSpy).toHaveBeenCalled(); |
| b69ab31 | | | 340 | }); |
| b69ab31 | | | 341 | }); |
| b69ab31 | | | 342 | |
| b69ab31 | | | 343 | describe('in commit info view for a given commit', () => { |
| b69ab31 | | | 344 | it('hides revert button on non-head commits', () => { |
| b69ab31 | | | 345 | CommitInfoTestUtils.clickToSelectCommit('a'); |
| b69ab31 | | | 346 | |
| b69ab31 | | | 347 | const revertButton = within( |
| b69ab31 | | | 348 | within(screen.getByTestId('commit-info-view')).getByTestId(`changed-file-file.txt`), |
| b69ab31 | | | 349 | ).queryByTestId('file-revert-button'); |
| b69ab31 | | | 350 | expect(revertButton).not.toBeInTheDocument(); |
| b69ab31 | | | 351 | }); |
| b69ab31 | | | 352 | |
| b69ab31 | | | 353 | it('reverts before head commit', async () => { |
| b69ab31 | | | 354 | CommitInfoTestUtils.clickToSelectCommit('c'); |
| b69ab31 | | | 355 | await clickRevert(screen.getByTestId('commit-info-view'), 'file.txt'); |
| b69ab31 | | | 356 | |
| b69ab31 | | | 357 | expectMessageSentToServer({ |
| b69ab31 | | | 358 | type: 'runOperation', |
| b69ab31 | | | 359 | operation: { |
| b69ab31 | | | 360 | args: [ |
| b69ab31 | | | 361 | 'revert', |
| b69ab31 | | | 362 | '--rev', |
| b69ab31 | | | 363 | {type: 'succeedable-revset', revset: '.^'}, |
| b69ab31 | | | 364 | {type: 'repo-relative-file-list', paths: ['file.txt']}, |
| b69ab31 | | | 365 | ], |
| b69ab31 | | | 366 | id: expect.anything(), |
| b69ab31 | | | 367 | runner: CommandRunner.Sapling, |
| b69ab31 | | | 368 | trackEventName: 'RevertOperation', |
| b69ab31 | | | 369 | }, |
| b69ab31 | | | 370 | }); |
| b69ab31 | | | 371 | }); |
| b69ab31 | | | 372 | |
| b69ab31 | | | 373 | it('renders optimistic state while running', async () => { |
| b69ab31 | | | 374 | CommitInfoTestUtils.clickToSelectCommit('c'); |
| b69ab31 | | | 375 | expect( |
| b69ab31 | | | 376 | CommitTreeListTestUtils.withinCommitTree().queryByText(ignoreRTL('file.txt')), |
| b69ab31 | | | 377 | ).not.toBeInTheDocument(); |
| b69ab31 | | | 378 | |
| b69ab31 | | | 379 | await clickRevert(screen.getByTestId('commit-info-view'), 'file.txt'); |
| b69ab31 | | | 380 | |
| b69ab31 | | | 381 | // file is not hidden from the tree, instead it's inserted |
| b69ab31 | | | 382 | expect( |
| b69ab31 | | | 383 | CommitTreeListTestUtils.withinCommitTree().getByText(ignoreRTL('file.txt')), |
| b69ab31 | | | 384 | ).toBeInTheDocument(); |
| b69ab31 | | | 385 | }); |
| b69ab31 | | | 386 | }); |
| b69ab31 | | | 387 | }); |