From 324d1ccf1da916740227cb6183e79d1ced81e7cf Mon Sep 17 00:00:00 2001 From: Bruno Agostini Date: Wed, 31 Jul 2019 14:02:53 -0300 Subject: [PATCH] Remove code from develop/2 --- schema.graphql | 4 -- tests/graphql.js | 107 +---------------------------------------------- 2 files changed, 1 insertion(+), 110 deletions(-) diff --git a/schema.graphql b/schema.graphql index 0c878a2..84e8f13 100644 --- a/schema.graphql +++ b/schema.graphql @@ -39,8 +39,4 @@ type JobAd { type Query { """Returns an incredible expected response""" ping: String! - - # TODO candidates - # TODO companies - # TODO jobAds } diff --git a/tests/graphql.js b/tests/graphql.js index ee43ff6..86f93cb 100644 --- a/tests/graphql.js +++ b/tests/graphql.js @@ -3,109 +3,4 @@ const app = require('../server'); const request = require('supertest'); const { expect } = require('chai'); -describe('POST /graphql', function() { - it('test query "candidates"', () => { - const graphlQuery = ` - query { - candidates { - name - - following { - name - } - } - } - `; - - return request(app) - .post('/graphql') - .send({ query: graphlQuery }) - .expect(200) - .then(res => { - const body = res.body; - expect(body).to.have.property('data'); - - const data = body.data; - expect(data).to.have.property('candidates'); - - data.candidates.forEach(candidate => { - expect(candidate).to.have.property('name'); - expect(candidate).to.have.property('following'); - - candidate.following.forEach(followee => { - expect(followee).to.have.property('name'); - }); - }); - }) - ; - }); - - it('test query "companies"', () => { - const graphlQuery = ` - query { - companies { - name - - openJobAds { - title - } - } - } - `; - - return request(app) - .post('/graphql') - .send({ query: graphlQuery }) - .expect(200) - .then(res => { - const body = res.body; - expect(body).to.have.property('data'); - - const data = body.data; - expect(data).to.have.property('companies'); - - data.companies.forEach(jobAd => { - expect(jobAd).to.have.property('name'); - expect(jobAd).to.have.property('openJobAds'); - - jobAd.openJobAds.forEach(jobAd => { - expect(jobAd).to.have.property('title'); - }); - }); - }) - ; - }); - - it('test query "jobAds"', () => { - const graphlQuery = ` - query { - jobAds { - title - - forCompany { - name - } - } - } - `; - - return request(app) - .post('/graphql') - .send({ query: graphlQuery }) - .expect(200) - .then(res => { - const body = res.body; - expect(body).to.have.property('data'); - - const data = body.data; - expect(data).to.have.property('jobAds'); - - data.jobAds.forEach(jobAd => { - expect(jobAd).to.have.property('title'); - expect(jobAd).to.have.property('forCompany'); - expect(jobAd.forCompany).to.have.property('name'); - }); - }) - ; - }); -}); +describe('POST /graphql', function() {});