Skip to content

Commit

Permalink
Remove code from develop/2
Browse files Browse the repository at this point in the history
  • Loading branch information
brunogsa committed Jul 31, 2019
1 parent 40dc78a commit 324d1cc
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 110 deletions.
4 changes: 0 additions & 4 deletions schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,4 @@ type JobAd {
type Query {
"""Returns an incredible expected response"""
ping: String!

# TODO candidates
# TODO companies
# TODO jobAds
}
107 changes: 1 addition & 106 deletions tests/graphql.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {});

0 comments on commit 324d1cc

Please sign in to comment.