Added API Tests

This commit is contained in:
jd
2026-02-21 00:34:50 +00:00
parent 335f1821cd
commit f81220f837
24 changed files with 450 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
info:
name: Login
type: http
seq: 1
http:
method: POST
url: http://localhost:3000/api/auth/login
headers:
- name: Content-Type
value: application/json
body:
type: json
data: |-
{
"email":"james@dardry.com",
"password":"Foobar"
}
auth: inherit
settings:
encodeUrl: true
timeout: 0
followRedirects: true
maxRedirects: 5

View File

@@ -0,0 +1,18 @@
info:
name: Token
type: http
seq: 2
http:
method: GET
url: http://localhost:3000/api/auth/token
headers:
- name: Cookie
value: refresh=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1IjoiMSIsInIiOiIxIiwiaWF0IjoxNzcxNTk3NjQ2LCJleHAiOjE3NzQxODk2NDZ9.07ViS5Nie3Bi2OgnlHyybDNZ9bdXPRRiqO-RFLhjoKo; Path=/; Max-Age=2592000; Secure; HttpOnly; SameSite=Lax
auth: inherit
settings:
encodeUrl: true
timeout: 0
followRedirects: true
maxRedirects: 5

View File

@@ -0,0 +1,4 @@
info:
name: Auth
type: folder
seq: 1

View File

@@ -0,0 +1,21 @@
info:
name: Create
type: http
seq: 1
http:
method: POST
url: http://localhost:3000/api/game
body:
type: json
data: |-
{
"name": "Test Game3"
}
auth: inherit
settings:
encodeUrl: true
timeout: 0
followRedirects: true
maxRedirects: 5

View File

@@ -0,0 +1,19 @@
info:
name: Delete
type: http
seq: 4
http:
method: DELETE
url: http://localhost:3000/api/game/:id
params:
- name: id
value: bk5e
type: path
auth: inherit
settings:
encodeUrl: true
timeout: 0
followRedirects: true
maxRedirects: 5

View File

@@ -0,0 +1,19 @@
info:
name: Get
type: http
seq: 2
http:
method: GET
url: http://localhost:3000/api/game/:id
params:
- name: id
value: bk5e
type: path
auth: inherit
settings:
encodeUrl: true
timeout: 0
followRedirects: true
maxRedirects: 5

View File

@@ -0,0 +1,19 @@
info:
name: Search
type: http
seq: 5
http:
method: GET
url: http://localhost:3000/api/game/search/:query
params:
- name: query
value: game
type: path
auth: inherit
settings:
encodeUrl: true
timeout: 0
followRedirects: true
maxRedirects: 5

View File

@@ -0,0 +1,25 @@
info:
name: Update
type: http
seq: 3
http:
method: PATCH
url: http://localhost:3000/api/game/:id
params:
- name: id
value: el5a
type: path
body:
type: json
data: |-
{
"name":"Updated game"
}
auth: inherit
settings:
encodeUrl: true
timeout: 0
followRedirects: true
maxRedirects: 5

View File

@@ -0,0 +1,7 @@
info:
name: Game
type: folder
seq: 4
request:
auth: inherit

View File

@@ -0,0 +1,22 @@
info:
name: Accept
type: http
seq: 2
http:
method: POST
url: http://localhost:3000/api/invite/accept
body:
type: json
data: |-
{
"inviteCode": "3ST6N8",
"password": "test123"
}
auth: inherit
settings:
encodeUrl: true
timeout: 0
followRedirects: true
maxRedirects: 5

View File

@@ -0,0 +1,22 @@
info:
name: Create
type: http
seq: 5
http:
method: POST
url: http://localhost:3000/api/invite
body:
type: json
data: |-
{
"email": "james+test2@dardry.com",
"playerId": "boja"
}
auth: inherit
settings:
encodeUrl: true
timeout: 0
followRedirects: true
maxRedirects: 5

View File

@@ -0,0 +1,7 @@
info:
name: Invites
type: folder
seq: 5
request:
auth: inherit

View File

@@ -0,0 +1,21 @@
info:
name: Create
type: http
seq: 1
http:
method: POST
url: http://localhost:3000/api/player
body:
type: json
data: |-
{
"name": "Invited player2"
}
auth: inherit
settings:
encodeUrl: true
timeout: 0
followRedirects: true
maxRedirects: 5

View File

@@ -0,0 +1,19 @@
info:
name: Delete
type: http
seq: 4
http:
method: DELETE
url: http://localhost:3000/api/player/:id
params:
- name: id
value: bmOe
type: path
auth: inherit
settings:
encodeUrl: true
timeout: 0
followRedirects: true
maxRedirects: 5

View File

@@ -0,0 +1,19 @@
info:
name: Get
type: http
seq: 2
http:
method: GET
url: http://localhost:3000/api/player/:id
params:
- name: id
value: ejRe
type: path
auth: inherit
settings:
encodeUrl: true
timeout: 0
followRedirects: true
maxRedirects: 5

View File

@@ -0,0 +1,15 @@
info:
name: List
type: http
seq: 5
http:
method: GET
url: http://localhost:3000/api/player/list
auth: inherit
settings:
encodeUrl: true
timeout: 0
followRedirects: true
maxRedirects: 5

View File

@@ -0,0 +1,27 @@
info:
name: Update
type: http
seq: 3
http:
method: PATCH
url: http://localhost:3000/api/player/:id
params:
- name: id
value: bmOe
type: path
body:
type: json
data: |-
{
"name": "Test Player",
"isRatingLocked": true,
"canBeMultiple": false
}
auth: inherit
settings:
encodeUrl: true
timeout: 0
followRedirects: true
maxRedirects: 5

View File

@@ -0,0 +1,7 @@
info:
name: Players
type: folder
seq: 2
request:
auth: inherit

View File

@@ -0,0 +1,23 @@
info:
name: Create
type: http
seq: 1
http:
method: POST
url: http://localhost:3000/api/user
body:
type: json
data: |-
{
"email": "Test User",
"password": "Test123",
"playerId": "enRe"
}
auth: inherit
settings:
encodeUrl: true
timeout: 0
followRedirects: true
maxRedirects: 5

View File

@@ -0,0 +1,19 @@
info:
name: Delete
type: http
seq: 4
http:
method: DELETE
url: http://localhost:3000/api/user/:id
params:
- name: id
value: ""
type: path
auth: inherit
settings:
encodeUrl: true
timeout: 0
followRedirects: true
maxRedirects: 5

View File

@@ -0,0 +1,19 @@
info:
name: Get
type: http
seq: 2
http:
method: GET
url: http://localhost:3000/api/user/:id
params:
- name: id
value: ejRe
type: path
auth: inherit
settings:
encodeUrl: true
timeout: 0
followRedirects: true
maxRedirects: 5

View File

@@ -0,0 +1,26 @@
info:
name: Update
type: http
seq: 3
http:
method: PATCH
url: http://localhost:3000/api/user/:id
params:
- name: id
value: ""
type: path
body:
type: json
data: |-
{
"isActive": true,
"isAdmin": false
}
auth: inherit
settings:
encodeUrl: true
timeout: 0
followRedirects: true
maxRedirects: 5

View File

@@ -0,0 +1,7 @@
info:
name: User
type: folder
seq: 3
request:
auth: inherit

View File

@@ -0,0 +1,40 @@
opencollection: 1.0.0
info:
name: BGApp
config:
proxy:
inherit: true
config:
protocol: http
hostname: ""
port: ""
auth:
username: ""
password: ""
bypassProxy: ""
request:
auth:
type: bearer
token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiJlalJlIiwiY2xhaW1zIjpbIkFETUlOIiwiVVNFUlNfQ1JFQVRFIiwiVVNFUlNfU0VMRl9SRUFEIiwiVVNFUlNfU0VMRl9VUERBVEUiLCJVU0VSU19TRUxGX0RFTEVURSIsIlVTRVJTX09USEVSX1JFQUQiLCJVU0VSU19PVEhFUl9VUERBVEUiXSwiaWF0IjoxNzcxNjE4NTQzLCJleHAiOjE4MDMxNTQ1NDN9.R-3Qb5CEcLJBSt7DnsO9b0IGRVYDIZuFfH1m9TikVXU
actions:
- type: set-variable
phase: after-response
selector:
expression: ${token}
method: jsonq
variable:
name: Token
scope: runtime
disabled: true
bundled: false
extensions:
bruno:
ignore:
- node_modules
- .git
presets:
request:
type: http
url: http://localhost:3000/api/