Skip to content

Commit

Permalink
Fix mocha unit tests for new form service method getform
Browse files Browse the repository at this point in the history
  • Loading branch information
alejandro-bulgaris-qcif committed Jun 25, 2024
1 parent 91aca99 commit 0e55a36
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions test/unit/services/FormsService.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,13 @@ describe('The FormsService', function () {
let formName = 'default-1.0-draft';
let record = {
metaMetadata: {
form: formName
form: formName,
type: 'rdmp'
}
};
FormsService.getForm(brand, '', true, '', record).subscribe(form => {
// expect(form).to.have.property('name', formName);
expect(true).to.eq(true);
expect(form).to.have.property('name', formName);
// expect(true).to.eq(true);
done();
})
});
Expand All @@ -52,7 +53,8 @@ describe('The FormsService', function () {
let formName = 'generated-view-only';
let record = {
metaMetadata: {
form: formName
form: formName,
type: 'rdmp'
}
};
FormsService.getForm(brand, '', true, '', record).subscribe(form => {
Expand All @@ -65,19 +67,19 @@ describe('The FormsService', function () {
it('should return the form', function (done) {
let brand = BrandingService.getDefault();
let formName = 'default-1.0-draft';
FormsService.getForm(brand, formName, true, '', {}).subscribe(form => {
// expect(form).to.have.property('name', formName);
expect(true).to.eq(true);
FormsService.getForm(brand, formName, true, 'rdmp', {}).subscribe(form => {
expect(form).to.have.property('name', formName);
// expect(true).to.eq(true);
done();
})
});

it('should return the autogenerated form', function (done) {
let brand = BrandingService.getDefault();
let formName = 'generated-view-only';
FormsService.getForm(brand, formName, true, '', {}).subscribe(form => {
// expect(form).to.have.property('name', formName);
expect(true).to.eq(true);
FormsService.getForm(brand, formName, true, 'rdmp', {}).subscribe(form => {
expect(form).to.have.property('name', formName);
//expect(true).to.eq(true);
done();
})
});
Expand Down

0 comments on commit 0e55a36

Please sign in to comment.