Skip to content

Commit

Permalink
Cypress test API use fixture
Browse files Browse the repository at this point in the history
  • Loading branch information
Enya committed Aug 22, 2023
1 parent 520f38f commit 8606d62
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 18 deletions.
20 changes: 20 additions & 0 deletions packages/frontend/cypress/fixtures/createRoom.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"createTime": "2023-07-04T19:29:54.001Z",
"status": "OK",
"msg": "",
"room": {
"roomId": "sxsxs111",
"roomName": "一起玩富饒之城",
"holderId": "player1",
"holderName": "陳XX",
"users": [
{
"userId": "player1",
"userImage": "imageName1",
"userName": "陳XX"
}
],
"status": "OPEN",
"totalUsers": 1
}
}
19 changes: 1 addition & 18 deletions packages/frontend/cypress/support/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,24 +36,7 @@ Cypress.Commands.add('setupIntercept', () => {
userImage: 'imageName1'
}
req.reply({
createTime: '2023-07-04T19:29:54.001Z',
status: 'OK',
msg: '',
room: {
roomId: 'sxsxs111',
roomName: '一起玩富饒之城',
holderId: 'player1',
holderName: '陳XX',
users: [
{
userId: 'player1',
userImage: 'imageName1',
userName: '陳XX'
}
],
status: 'OPEN',
totalUsers: 1
}
fixture: 'createRoom.json'
})
}
).as('createRoomRequest')
Expand Down

0 comments on commit 8606d62

Please sign in to comment.