Skip to content

Commit

Permalink
#30 switch out incorrect tests
Browse files Browse the repository at this point in the history
  • Loading branch information
poludnev committed Jul 5, 2023
1 parent 70f1845 commit 8a51ab3
Showing 1 changed file with 31 additions and 28 deletions.
59 changes: 31 additions & 28 deletions tests/controllers.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,36 +77,39 @@ describe('testing routes', async () => {
expect(json.error).to.equal('invalid tweet id');
});
});
it('valid tweet id, unavailable tweet', (done) => {
chai
.request(server)
.get('/previewData?tweetId=123123')
.end((err, res) => {
expect(res.ok).to.be.true;
expect(res.status).to.equal(200);
const { imageUrl, tweetdata, metadata } = JSON.parse(res.text);

expect(!!imageUrl).to.be.true;
expect(!!tweetdata).to.be.true;
expect(metadata).to.be.string;
done();
});
});
it('valid tweet id, available tweet', (done) => {
chai
.request(server)
.get('/previewData?tweetId=1639773626709712896')
.end((err, res) => {
expect(res.ok).to.be.true;
expect(res.status).to.equal(200);
const { imageUrl, tweetdata, metadata } = JSON.parse(res.text);
//TODO: revise tests as handler changed
//https://github.com/orgs/NotarizedScreenshot/projects/1?pane=issue&itemId=23440574
// it('valid tweet id, unavailable tweet', (done) => {
// chai
// .request(server)
// .get('/previewData?tweetId=123123')
// .end((err, res) => {
// expect(res.ok).to.be.true;
// expect(res.status).to.equal(200);
// const { imageUrl, tweetdata, metadata } = JSON.parse(res.text);

expect(!!imageUrl).to.be.true;
expect(!!tweetdata).to.be.true;
expect(metadata).to.be.string;
done();
});
});
// expect(!!imageUrl).to.be.true;
// expect(!!tweetdata).to.be.true;
// expect(metadata).to.be.string;
// done();
// });
// });
// it('valid tweet id, available tweet', (done) => {
// chai
// .request(server)
// .get('/previewData?tweetId=1639773626709712896')
// .end((err, res) => {
// expect(res.ok).to.be.true;
// expect(res.status).to.equal(200);
// const { imageUrl, tweetdata, metadata } = JSON.parse(res.text);

// expect(!!imageUrl).to.be.true;
// expect(!!tweetdata).to.be.true;
// expect(metadata).to.be.string;
// done();
// });
// });
});

describe('testing POST /adapter_response', () => {
Expand Down

0 comments on commit 8a51ab3

Please sign in to comment.