Skip to content

Commit 92f3e76

Browse files
committed
Set test input file from buffer.
1 parent c9534b9 commit 92f3e76

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

dev-packages/e2e-tests/test-applications/create-remix-app-express/tests/behaviour-server.test.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,15 @@ test('Sends a loader error to Sentry', async ({ page }) => {
1414
expect(loaderError.contexts.trace.op).toBe('http.server');
1515
});
1616

17-
test('Sends formdata with action error to Sentry', async ({ page }, workerInfo) => {
17+
test('Sends form data with action error to Sentry', async ({ page }) => {
1818
await page.goto('/action-formdata');
1919

2020
await page.fill('input[name=test]', 'test');
21-
await page.setInputFiles('input[type=file]', `${workerInfo.project.testDir}/static/test.txt`);
21+
await page.setInputFiles('input[type=file]', {
22+
name: 'file.txt',
23+
mimeType: 'text/plain',
24+
buffer: Buffer.from('this is test'),
25+
});
2226

2327
const formdataActionTransaction = waitForTransaction('create-remix-app-express', transactionEvent => {
2428
return transactionEvent?.spans?.some(span => span.op === 'function.remix.action');
@@ -32,6 +36,6 @@ test('Sends formdata with action error to Sentry', async ({ page }, workerInfo)
3236
expect(actionTransaction.contexts.trace.op).toBe('http.server');
3337
expect(actionTransaction.spans[0].data).toMatchObject({
3438
action_form_data_test: 'test',
35-
action_form_data_file: 'test.txt',
39+
action_form_data_file: 'file.txt',
3640
});
3741
});

dev-packages/e2e-tests/test-applications/create-remix-app-express/tests/static/test.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)