Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ class Suggestion extends BaseModel {
FIXED: 'FIXED',
ERROR: 'ERROR',
OUTDATED: 'OUTDATED',
PENDING_VALIDATION: 'PENDING_VALIDATION',
};

static TYPES = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ describe('SuggestionCollection', () => {

it('throws an error if status is not provided', async () => {
await expect(instance.bulkUpdateStatus([model], 'foo'))
.to.be.rejectedWith('Invalid status: foo. Must be one of: NEW, APPROVED, IN_PROGRESS, SKIPPED, FIXED, ERROR');
.to.be.rejectedWith('Invalid status: foo. Must be one of: NEW, APPROVED, IN_PROGRESS, SKIPPED, FIXED, ERROR, OUTDATED, PENDING_VALIDATION');
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,20 @@ chaiUse(chaiAsPromised);
chaiUse(sinonChai);

describe('SuggestionModel', () => {
describe('STATUSES', () => {
it('has STATUSES enum', () => {
expect(Suggestion.STATUSES).to.be.an('object');
expect(Suggestion.STATUSES.NEW).to.equal('NEW');
expect(Suggestion.STATUSES.APPROVED).to.equal('APPROVED');
expect(Suggestion.STATUSES.IN_PROGRESS).to.equal('IN_PROGRESS');
expect(Suggestion.STATUSES.SKIPPED).to.equal('SKIPPED');
expect(Suggestion.STATUSES.FIXED).to.equal('FIXED');
expect(Suggestion.STATUSES.ERROR).to.equal('ERROR');
expect(Suggestion.STATUSES.OUTDATED).to.equal('OUTDATED');
expect(Suggestion.STATUSES.PENDING_VALIDATION).to.equal('PENDING_VALIDATION');
});
});

let instance;

let mockElectroService;
Expand Down Expand Up @@ -90,6 +104,11 @@ describe('SuggestionModel', () => {
instance.setStatus('OUTDATED');
expect(instance.record.status).to.equal('OUTDATED');
});

it('sets the status of the suggestion to PENDING_VALIDATION', () => {
instance.setStatus('PENDING_VALIDATION');
expect(instance.record.status).to.equal('PENDING_VALIDATION');
});
});

describe('getRank and setRank', () => {
Expand Down