Forked from an inaccessible project.
-
Olivér FACKLAM authoredOlivér FACKLAM authored
testData.js 2.69 KiB
/*
* This is the list of unit tests which will be ran by the npm test command.
* To add new unit tests, just write the query you want to test in GraphiQL,
* then add new entries to the list with the following format :
* query : the query you wrote
* result : the output returned by GraphiQL
* description : what the test does
*
* Tests should be written to work on the current seed
* If the seed is modified, the expected result for the tests will have to be changed as well
*/
exports.testList = [
{
query : `query{allGroups{name}}`,
result: {
"allGroups": [
{ "name": "BR" },
{ "name": "JTX" },
{ "name": "Faërix" },
{ "name": "Bôbar" },
{ "name": "Kès" },
{ "name": "Subaïsse" },
{ "name": "X-Broadway" },
{ "name": "Œnologie" },
{ "name": "Tribunes de l'X" },
{ "name": "X-Finance" },
{ "name": "ASK" }
]
},
description : "Should query all groups"
},
{
query : `
query{group(uid : "br"){
uid,
name,
website
}}`,
result : {
"group": {
"uid": "br",
"name": "BR",
"website": "br.binets.fr"
}
},
description : "Should query a single group"
},
{
query : `query{
allMessages{
id,
title,
content
}
}`,
result : {
"allMessages": [
{
"id": "11",
"title": "Fête de la lune",
"content": "La fête de la lune, c'est bientôt dans le grand hall !"
},
{
"id": "12",
"title": "Perm BR du mardi soir",
"content": "La perm' BR c'est maintenant!"
},
{
"id": "13",
"title": "Formation Git",
"content": "Aujourd'hui, on va parler du système de contrôle de versions Git, qui est particulièrement utile pour travailler à plusieurs sur des projets informatiques: PSC, code de PI ou de projet de MAP, site binet, quoi que ce soit!"
},
{
"id": "14",
"title": "Formation Web",
"content": "Envie d'apprendre à faire un site Web en Django ? Alors viens en amphi Sauvy ce jeudi à 20h !"
}
]
},
description : "Should fetch all messages"
}
];