Skip to content

Commit

Permalink
Remove tests from develop/3
Browse files Browse the repository at this point in the history
  • Loading branch information
brunogsa committed Jul 31, 2019
1 parent 8adcf3a commit be26b8f
Showing 1 changed file with 0 additions and 156 deletions.
156 changes: 0 additions & 156 deletions tests/graphql.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,86 +40,6 @@ describe('POST /graphql', function() {
;
});

it('test query "candidate" with id', () => {
const graphlQuery = `
query {
candidate(id: 1) {
id
name
email
profession
photo
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('candidate');
expect(data.candidate).to.have.property('id');
expect(data.candidate).to.have.property('name');
expect(data.candidate).to.have.property('email');
expect(data.candidate).to.have.property('profession');
expect(data.candidate).to.have.property('photo');

data.candidate.following.forEach(folowee => {
expect(folowee).to.have.property('name');
});
})
;
});

it('test query "candidate" with email', () => {
const graphlQuery = `
query {
candidate(email: "sandrinha@gmail.com") {
id
name
email
profession
photo
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('candidate');
expect(data.candidate).to.have.property('id');
expect(data.candidate).to.have.property('name');
expect(data.candidate).to.have.property('email');
expect(data.candidate).to.have.property('profession');
expect(data.candidate).to.have.property('photo');

data.candidate.following.forEach(folowee => {
expect(folowee).to.have.property('name');
});
})
;
});

it('test query "companies"', () => {
const graphlQuery = `
query {
Expand Down Expand Up @@ -156,44 +76,6 @@ describe('POST /graphql', function() {
;
});

it('test query "company"', () => {
const graphlQuery = `
query {
company(id: 666) {
id
name
photo
openJobAds {
title
remainingVacancies
}
}
}
`;

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('company');
expect(data.company).to.have.property('id');
expect(data.company).to.have.property('name');
expect(data.company).to.have.property('photo');

data.company.openJobAds.forEach(jobAd => {
expect(jobAd).to.have.property('title');
expect(jobAd).to.have.property('remainingVacancies');
});
})
;
});

it('test query "jobAds"', () => {
const graphlQuery = `
query {
Expand Down Expand Up @@ -226,42 +108,4 @@ describe('POST /graphql', function() {
})
;
});

it('test query "jobAd"', () => {
const graphlQuery = `
query {
jobAd(id: 1) {
id
title
description
requiredProfession
remainingVacancies
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('jobAd');
expect(data.jobAd).to.have.property('id');
expect(data.jobAd).to.have.property('title');
expect(data.jobAd).to.have.property('description');
expect(data.jobAd).to.have.property('requiredProfession');
expect(data.jobAd).to.have.property('remainingVacancies');
expect(data.jobAd).to.have.property('forCompany');
expect(data.jobAd.forCompany).to.have.property('name');
})
;
});
});

0 comments on commit be26b8f

Please sign in to comment.