Skip to content

Commit

Permalink
fix: tests to reference new names from model
Browse files Browse the repository at this point in the history
  • Loading branch information
gwynndp committed Feb 3, 2022
1 parent bdd8a20 commit fbf0b01
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
2 changes: 2 additions & 0 deletions server/models/Stakeholder.js
Original file line number Diff line number Diff line change
Expand Up @@ -596,4 +596,6 @@ module.exports = {
getNonRelations,
createRelation,
deleteRelation,
StakeholderTree,
FilterCriteria
};
14 changes: 8 additions & 6 deletions server/models/Stakeholder.spec.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
const { expect } = require('chai');
const sinon = require('sinon');
const {
getStakeholders,
Stakeholder,
getAllStakeholders,
StakeholderTree,
FilterCriteria,
} = require('./Stakeholder');

describe('Stakeholder Model', () => {
it('Stakeholder Model should return defined fields', () => {
const stakeholder = Stakeholder({});
const stakeholder = StakeholderTree({});
expect(stakeholder).to.have.keys([
'id',
'type',
Expand All @@ -29,6 +29,8 @@ describe('Stakeholder Model', () => {
'map',
'owner_id',
'organization_id',
'parents',
'children'
]);
});

Expand Down Expand Up @@ -57,11 +59,11 @@ describe('Stakeholder Model', () => {
});
});

describe('getStakeholders', () => {
describe('getAllStakeholders', () => {
it('should get stakeholders with filter --id', async () => {
const getFilterById = sinon.mock();
const getStakeholderByOrganizationId = sinon.mock();
const executeGetStakeholders = getStakeholders({
const executeGetStakeholders = getAllStakeholders({
getFilterById,
getStakeholderByOrganizationId,
});
Expand All @@ -86,7 +88,7 @@ describe('Stakeholder Model', () => {
it('should get stakeholders with filter --organization_id', async () => {
const getStakeholderByOrganizationId = sinon.mock();
const getFilterById = sinon.mock();
const executeGetStakeholders = getStakeholders({
const executeGetStakeholders = getAllStakeholders({
getStakeholderByOrganizationId,
getFilterById,
});
Expand Down
2 changes: 1 addition & 1 deletion server/repositories/StakeholderRepository.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ class StakeholderRepository extends BaseRepository {
return { stakeholders: results, count: +count[0].count };
}

// not currently being used
// not currently being used but may be useful later
async getStakeholderTreeById(id, options) {
const stakeholder = await this._session
.getDB()(this._tableName)
Expand Down

0 comments on commit fbf0b01

Please sign in to comment.