Commit 237f16da authored by Fatih Acet's avatar Fatih Acet

MRWidget: Fix approval footer JS spec.

parent 5cc1abf9
...@@ -21,6 +21,10 @@ import ApprovalsFooter from '~/vue_merge_request_widget/ee/components/approvals/ ...@@ -21,6 +21,10 @@ import ApprovalsFooter from '~/vue_merge_request_widget/ee/components/approvals/
`); `);
this.initialData = { this.initialData = {
mr: {
state: 'readyToMerge',
},
service: {},
userCanApprove: false, userCanApprove: false,
userHasApproved: true, userHasApproved: true,
approvedBy: [], approvedBy: [],
...@@ -53,7 +57,9 @@ import ApprovalsFooter from '~/vue_merge_request_widget/ee/components/approvals/ ...@@ -53,7 +57,9 @@ import ApprovalsFooter from '~/vue_merge_request_widget/ee/components/approvals/
describe('Computed properties', function () { describe('Computed properties', function () {
it('should correctly set showUnapproveButton when the user can unapprove', function () { it('should correctly set showUnapproveButton when the user can unapprove', function () {
expect(this.approvalsFooter.showUnapproveButton).toBe(true); expect(this.approvalsFooter.showUnapproveButton).toBeTruthy();
this.approvalsFooter.mr.state = 'merged';
expect(this.approvalsFooter.showUnapproveButton).toBeFalsy();
}); });
it('should correctly set showUnapproveButton when the user can not unapprove', function (done) { it('should correctly set showUnapproveButton when the user can not unapprove', function (done) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment