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 0f051bf commit b96a97f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
16 changes: 8 additions & 8 deletions tests/resources/projects.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ describe('Project Resource CRUD', function () {
page: 1,
limit: 100,
});
expect(projects.length).to.equal(12);
expect(projects.data.length).to.equal(12);
}).timeout(TEST_WAIT_TIME * 10);

it('gets all the projects filtered by orgUid', async function () {
Expand All @@ -71,7 +71,7 @@ describe('Project Resource CRUD', function () {
page: 1,
limit: 100,
});
expect(projects.length).to.equal(3);
expect(projects.data.length).to.equal(3);
}).timeout(TEST_WAIT_TIME * 10);

it('gets all the projects for a search term', async function () {
Expand All @@ -81,7 +81,7 @@ describe('Project Resource CRUD', function () {
page: 1,
limit: 100,
});
expect(projects.length).to.equal(1);
expect(projects.data.length).to.equal(1);
}).timeout(TEST_WAIT_TIME * 10);

it('gets all the projects for a search term filtered by orgUid', async function () {
Expand All @@ -93,7 +93,7 @@ describe('Project Resource CRUD', function () {
limit: 100,
});

expect(projects.length).to.equal(1);
expect(projects.data.length).to.equal(1);
}).timeout(TEST_WAIT_TIME * 10);

it('gets optional paginated results', async function () {
Expand All @@ -102,24 +102,24 @@ describe('Project Resource CRUD', function () {
page: 1,
limit: 3,
});
expect(projectsPage1.length).to.equal(3);
expect(projectsPage1.data.length).to.equal(3);

const projectsPage2 = await testFixtures.getProjectByQuery({
page: 2,
limit: 3,
});

expect(projectsPage2.length).to.equal(3);
expect(projectsPage2.data.length).to.equal(3);
expect(projectsPage1).to.not.deep.equal(projectsPage2);

const projectsLimit2 = await testFixtures.getProjectByQuery({
page: 1,
limit: 2,
});
expect(projectsLimit2.length).to.equal(2);
expect(projectsLimit2.data.length).to.equal(2);
}).timeout(TEST_WAIT_TIME * 10);

it('finds a single result by warehouseProjectId', async function () {
it.only('finds a single result by warehouseProjectId', async function () {
// ?warehouseProjectId=XXXX
const projects = await testFixtures.getProjectByQuery({
warehouseProjectId: '7f3a656e-d21c-409f-ae38-f97c89f0ae66',
Expand Down
2 changes: 1 addition & 1 deletion tests/test-fixtures/project-fixtures.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export const getProjectByQuery = async (query = {}) => {
// expect(result.body).to.be.an('array');
expect(result.statusCode).to.equal(200);

return result.body.data;
return result.body;
};

export const checkProjectRecordExists = async (warehouseProjectId) => {
Expand Down

0 comments on commit b96a97f

Please sign in to comment.