(screenshot = false)
| 186 | }); |
| 187 | |
| 188 | async function importCsv(screenshot = false) { |
| 189 | const fileChooserPromise = page.waitForEvent('filechooser'); |
| 190 | await accountPage.page.getByRole('button', { name: 'Import' }).click(); |
| 191 | |
| 192 | const fileChooser = await fileChooserPromise; |
| 193 | await fileChooser.setFiles(join(__dirname, 'data/test.csv')); |
| 194 | |
| 195 | const importButton = accountPage.page.getByRole('button', { |
| 196 | name: /Import \d+ transactions/, |
| 197 | }); |
| 198 | |
| 199 | await importButton.waitFor({ state: 'visible' }); |
| 200 | |
| 201 | if (screenshot) await expect(page).toMatchThemeScreenshots(); |
| 202 | |
| 203 | await importButton.click(); |
| 204 | |
| 205 | await expect(importButton).not.toBeVisible(); |
| 206 | } |
| 207 | |
| 208 | test('imports transactions from a CSV file', async () => { |
| 209 | await importCsv(true); |
no test coverage detected