mirror of
https://github.com/tcgdex/cards-database.git
synced 2025-04-22 10:52:10 +00:00
feat: Add bruno to tests the APIs (#468)
This commit is contained in:
parent
8fd7afeb32
commit
8684fb14e4
33
.bruno/GraphQL API.bru
Normal file
33
.bruno/GraphQL API.bru
Normal file
@ -0,0 +1,33 @@
|
||||
meta {
|
||||
name: GraphQL API
|
||||
type: graphql
|
||||
seq: 2
|
||||
}
|
||||
|
||||
post {
|
||||
url: {{BASE_URL}}/v2/graphql
|
||||
body: graphql
|
||||
auth: none
|
||||
}
|
||||
|
||||
body:graphql {
|
||||
query Pouet {
|
||||
cards {
|
||||
id
|
||||
localId
|
||||
name
|
||||
set {
|
||||
id
|
||||
name
|
||||
serie {
|
||||
id
|
||||
name
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
assert {
|
||||
res.status: eq 200
|
||||
}
|
15
.bruno/Validate that we can run OPTIONS.bru
Normal file
15
.bruno/Validate that we can run OPTIONS.bru
Normal file
@ -0,0 +1,15 @@
|
||||
meta {
|
||||
name: Validate that we can run OPTIONS
|
||||
type: http
|
||||
seq: 1
|
||||
}
|
||||
|
||||
options {
|
||||
url: {{BASE_URL}}/status
|
||||
body: none
|
||||
auth: none
|
||||
}
|
||||
|
||||
assert {
|
||||
res.status: eq 200
|
||||
}
|
8
.bruno/bruno.json
Normal file
8
.bruno/bruno.json
Normal file
@ -0,0 +1,8 @@
|
||||
{
|
||||
"version": "1",
|
||||
"name": "TCGdex",
|
||||
"type": "collection",
|
||||
"presets": {
|
||||
"requestType": "http"
|
||||
}
|
||||
}
|
27
.bruno/cards/get Card list.bru
Normal file
27
.bruno/cards/get Card list.bru
Normal file
@ -0,0 +1,27 @@
|
||||
meta {
|
||||
name: get Card list
|
||||
type: http
|
||||
seq: 1
|
||||
}
|
||||
|
||||
get {
|
||||
url: {{BASE_URL}}/v2/en/cards?sort:field=name&sort:order=DESC&pagination:page=1&pagination:itemsPerPage=4
|
||||
body: none
|
||||
auth: none
|
||||
}
|
||||
|
||||
query {
|
||||
sort:field: name
|
||||
sort:order: DESC
|
||||
pagination:page: 1
|
||||
pagination:itemsPerPage: 4
|
||||
~name: furret
|
||||
}
|
||||
|
||||
docs {
|
||||
Fully describe the card list request, it also has every parameters it can
|
||||
}
|
||||
|
||||
assert {
|
||||
res.status: eq 200
|
||||
}
|
15
.bruno/cards/get one card.bru
Normal file
15
.bruno/cards/get one card.bru
Normal file
@ -0,0 +1,15 @@
|
||||
meta {
|
||||
name: get one card
|
||||
type: http
|
||||
seq: 2
|
||||
}
|
||||
|
||||
get {
|
||||
url: {{BASE_URL}}/v2/en/cards/swsh3-136
|
||||
body: none
|
||||
auth: none
|
||||
}
|
||||
|
||||
assert {
|
||||
res.status: eq 200
|
||||
}
|
3
.bruno/environments/Developpement.bru
Normal file
3
.bruno/environments/Developpement.bru
Normal file
@ -0,0 +1,3 @@
|
||||
vars {
|
||||
BASE_URL: http://localhost:3000
|
||||
}
|
3
.bruno/environments/Production.bru
Normal file
3
.bruno/environments/Production.bru
Normal file
@ -0,0 +1,3 @@
|
||||
vars {
|
||||
BASE_URL: https://api.tcgdex.net
|
||||
}
|
22
.bruno/fixes/invalid sorting.bru
Normal file
22
.bruno/fixes/invalid sorting.bru
Normal file
@ -0,0 +1,22 @@
|
||||
meta {
|
||||
name: invalid sorting
|
||||
type: http
|
||||
seq: 1
|
||||
}
|
||||
|
||||
get {
|
||||
url: {{BASE_URL}}/v2/en/sets/swsh8/53
|
||||
body: none
|
||||
auth: none
|
||||
}
|
||||
|
||||
assert {
|
||||
res.body.id: eq swsh8-53
|
||||
res.status: eq 200
|
||||
}
|
||||
|
||||
docs {
|
||||
Validate the issue seen in
|
||||
|
||||
https://github.com/tcgdex/cards-database/issues/466
|
||||
}
|
15
.bruno/sets/get a set.bru
Normal file
15
.bruno/sets/get a set.bru
Normal file
@ -0,0 +1,15 @@
|
||||
meta {
|
||||
name: get a set
|
||||
type: http
|
||||
seq: 2
|
||||
}
|
||||
|
||||
get {
|
||||
url: {{BASE_URL}}/v2/en/sets/swsh3
|
||||
body: none
|
||||
auth: none
|
||||
}
|
||||
|
||||
assert {
|
||||
res.status: eq 200
|
||||
}
|
23
.bruno/sets/get list of sets.bru
Normal file
23
.bruno/sets/get list of sets.bru
Normal file
@ -0,0 +1,23 @@
|
||||
meta {
|
||||
name: get list of sets
|
||||
type: http
|
||||
seq: 3
|
||||
}
|
||||
|
||||
get {
|
||||
url: {{BASE_URL}}/v2/en/sets?sort:field=name&sort:order=DESC&pagination:page=1&pagination:itemsPerPage=1&name=Dark
|
||||
body: none
|
||||
auth: none
|
||||
}
|
||||
|
||||
query {
|
||||
sort:field: name
|
||||
sort:order: DESC
|
||||
pagination:page: 1
|
||||
pagination:itemsPerPage: 1
|
||||
name: Dark
|
||||
}
|
||||
|
||||
assert {
|
||||
res.status: eq 200
|
||||
}
|
15
.bruno/sets/get one card from a set.bru
Normal file
15
.bruno/sets/get one card from a set.bru
Normal file
@ -0,0 +1,15 @@
|
||||
meta {
|
||||
name: get one card from a set
|
||||
type: http
|
||||
seq: 1
|
||||
}
|
||||
|
||||
get {
|
||||
url: {{BASE_URL}}/v2/en/cards/swsh3
|
||||
body: none
|
||||
auth: none
|
||||
}
|
||||
|
||||
assert {
|
||||
res.status: eq 200
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user