17 lines
459 B
TypeScript
17 lines
459 B
TypeScript
import { expect } from 'chai';
|
|
|
|
export function checkSuccessResponse(response, withData = true) {
|
|
expect(response).to.be.an('object');
|
|
expect(response.code).equal(0);
|
|
if (withData) {
|
|
expect(response.data).to.be.an('object');
|
|
}
|
|
}
|
|
|
|
export function checkDisplayItems(items) {
|
|
expect(items).to.be.an('array');
|
|
items.forEach(item => {
|
|
expect(item.id).to.be.a('number');
|
|
expect(item.count).to.be.a('number');
|
|
})
|
|
} |