File tree 3 files changed +9
-65
lines changed
3 files changed +9
-65
lines changed Original file line number Diff line number Diff line change 1
1
Feature : Attendee Importation
2
2
Scenario : POST /attendees
3
- When I make a POST request to "/attendees" with file "attendees.csv"
3
+ When I make a POST request to "/attendees" with file:
4
+ """
5
+ token,display_name,
6
+ "fccfc8bfa07643a1ca8015cbe74f5f17","Aotoki",
7
+ "93dc46e553ac602b0d6c6d7307e523f1","Danny",
8
+ """
4
9
Then the response status should be 200
Original file line number Diff line number Diff line change 1
1
import { Then , When } from '@cucumber/cucumber'
2
2
import { WorkerWorld } from './world'
3
3
import { expect } from 'expect'
4
- import { readFileSync } from 'node:fs'
5
4
6
5
const nestedAttribute = ( obj : any , path : string ) =>
7
6
path . split ( '.' ) . reduce ( ( prev , curr ) => prev ?. [ curr ] , obj )
@@ -22,11 +21,10 @@ When(
22
21
)
23
22
24
23
When (
25
- 'I make a POST request to {string} with file {string} ' ,
26
- async function ( this : WorkerWorld , path : string , filePath : string ) {
24
+ 'I make a POST request to {string} with file: ' ,
25
+ async function ( this : WorkerWorld , path : string , content : string ) {
27
26
const formData = new FormData ( )
28
- const file = readFileSync ( `${ __dirname } /data/${ filePath } ` , 'utf8' )
29
- formData . append ( 'file' , file )
27
+ formData . append ( 'file' , content )
30
28
this . apiResponse = await this . api . fetch ( `https://ccip.opass.app${ path } ` , {
31
29
method : 'POST' ,
32
30
headers : { 'Content-Type' : 'application/x-www-form-urlencoded' } ,
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments