Fix tests

This commit is contained in:
CptSpaceToaster
2021-02-21 01:21:18 -05:00
parent 239b18bcd3
commit 74055255e3
2 changed files with 7 additions and 12 deletions

View File

@ -13,7 +13,7 @@ describe('Client', () => {
Client.get('cards', params)
.then(response => {
expect(response).to.be.a('array');
expect(response[0].name).to.equal('Gardevoir');
expect(response[0].name).to.equal('Ampharos');
});
});
@ -21,7 +21,7 @@ describe('Client', () => {
Client.get('cards')
.then(response => {
expect(response).to.be.a('array');
expect(response.length).to.equal(100);
expect(response.length).to.equal(250);
});
});
@ -56,7 +56,7 @@ describe('Client', () => {
.then(response => {
expect(response).to.be.a('array');
expect(response[0]).to.be.a('object');
expect(response[0].code).to.equal('base1');
expect(response[0].id).to.equal('base1');
});
});

View File

@ -16,13 +16,8 @@ describe('QueryBuilder', () => {
it('should use where to filter data', () => {
const params: IQuery[] = [
{
name: 'name',
value: 'Charizard'
},
{
name: 'setCode',
value: 'base1'
name: 'q',
value: 'name:Charizard set.id:base1'
}
];
@ -30,14 +25,14 @@ describe('QueryBuilder', () => {
.then(cards => {
expect(cards.length).to.equal(1);
expect(cards[0].id).to.equal('base1-4');
expect(cards[0].set).to.equal('Base');
expect(cards[0].set.name).to.equal('Base');
});
});
it('should use all to get all cards', () => {
QueryBuilder.all<Card>(Card)
.then(cards => {
expect(cards.length).to.equal(1000);
expect(cards.length).to.equal(250);
});
});
});