Skip to content

Commit 83a7ee1

Browse files
committed
test with working files
1 parent 4b19533 commit 83a7ee1

File tree

3 files changed

+51
-0
lines changed

3 files changed

+51
-0
lines changed
346 KB
Binary file not shown.
346 KB
Binary file not shown.

src/frontend/apps/e2e/__tests__/app-impress/doc-import.spec.ts

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,57 @@ test.describe('Doc Import', () => {
6565
await expect(docsGrid.getByText('test_import.docx').first()).toBeVisible();
6666
await expect(docsGrid.getByText('test_import.md').first()).toBeVisible();
6767
});
68+
69+
test('it imports TOTO TUTU with the import icon', async ({ page }) => {
70+
const fileChooserPromise = page.waitForEvent('filechooser');
71+
await page.getByLabel('Open the upload dialog').click();
72+
73+
const fileChooser = await fileChooserPromise;
74+
await fileChooser.setFiles(path.join(__dirname, 'assets/toto.docx'));
75+
await fileChooser.setFiles(path.join(__dirname, 'assets/tutu.docx'));
76+
77+
await expect(
78+
page.getByText('The document "toto.docx" has been successfully imported'),
79+
).toBeVisible();
80+
await expect(
81+
page.getByText('The document "tutu.docx" has been successfully imported'),
82+
).toBeVisible();
83+
84+
const docsGrid = page.getByTestId('docs-grid');
85+
await expect(docsGrid.getByText('toto.docx').first()).toBeVisible();
86+
await expect(docsGrid.getByText('tutu.docx').first()).toBeVisible();
87+
});
88+
89+
test('it imports TOTO TUTU with the drag and drop area', async ({ page }) => {
90+
const docsGrid = page.getByTestId('docs-grid');
91+
await expect(docsGrid).toBeVisible();
92+
93+
await dragAndDropFiles(page, "[data-testid='docs-grid']", [
94+
{
95+
filePath: path.join(__dirname, 'assets/toto.docx'),
96+
fileName: 'toto.docx',
97+
fileType:
98+
'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
99+
},
100+
{
101+
filePath: path.join(__dirname, 'assets/tutu.docx'),
102+
fileName: 'tutu.docx',
103+
fileType:
104+
'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
105+
},
106+
]);
107+
108+
// Wait for success messages
109+
await expect(
110+
page.getByText('The document "toto.docx" has been successfully imported'),
111+
).toBeVisible();
112+
await expect(
113+
page.getByText('The document "tutu.docx" has been successfully imported'),
114+
).toBeVisible();
115+
116+
await expect(docsGrid.getByText('toto.docx').first()).toBeVisible();
117+
await expect(docsGrid.getByText('tutu.docx').first()).toBeVisible();
118+
});
68119
});
69120

70121
const dragAndDropFiles = async (

0 commit comments

Comments
 (0)