Skip to content

Commit

Permalink
fix: tests
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelTaylor3D committed Dec 14, 2023
1 parent b96a97f commit a23ecbc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion tests/resources/projects.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ describe('Project Resource CRUD', function () {
...newProject,
});

const warehouseProjectId = _.head(responseCreate.body);
const warehouseProjectId = responseCreate.body.uuid;

await Organization.destroy({
where: {},
Expand Down
13 changes: 9 additions & 4 deletions tests/resources/units.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,15 +115,20 @@ describe('Units Resource CRUD', function () {

expect(result.body.data.length).to.not.equal(1);
}).timeout(TEST_WAIT_TIME * 10);
it('finds a single result by warehouseUnitId', async function () {
it.only('finds a single result by warehouseUnitId', async function () {
// ?warehouseUnitId=XXXX
const result = await supertest(app).get('/v1/units').query({
warehouseUnitId: response.warehouseUnitId,
page: 1,
limit: 100,
});

expect(result.body.data.length).to.not.equal(1);
// Check if data is an object
expect(result.body).to.be.an('object');

// Additionally, ensure it's not an array
expect(Array.isArray(result?.body?.data)).to.be.false;

// Your existing assertion
expect(result.body?.data).to.not.equal(1);
}).timeout(TEST_WAIT_TIME * 10);
});
});
Expand Down

0 comments on commit a23ecbc

Please sign in to comment.