Commit 4248cb0c authored by Mike Greiling's avatar Mike Greiling

Update tests to correspond with GlButton changes

parent a51135fb
......@@ -269,7 +269,7 @@ describe('ReadyToMerge', () => {
const button = findMergeButton();
expect(button.exists()).toBe(true);
expect(button.attributes('disabled')).toBe('disabled');
expect(button.attributes('disabled')).toBe('true');
});
});
});
......
......@@ -145,34 +145,30 @@ describe('ReadyToMerge', () => {
});
});
describe('mergeButtonClass', () => {
const defaultClass = 'btn btn-sm btn-success accept-merge-request';
const failedClass = `${defaultClass} btn-danger`;
const inActionClass = `${defaultClass} btn-info`;
describe('mergeButtonVariant', () => {
it('defaults to success class', () => {
Vue.set(vm.mr, 'availableAutoMergeStrategies', []);
expect(vm.mergeButtonClass).toEqual(defaultClass);
expect(vm.mergeButtonVariant).toEqual('success');
});
it('returns success class for success status', () => {
Vue.set(vm.mr, 'availableAutoMergeStrategies', []);
Vue.set(vm.mr, 'pipeline', true);
expect(vm.mergeButtonClass).toEqual(defaultClass);
expect(vm.mergeButtonVariant).toEqual('success');
});
it('returns info class for pending status', () => {
Vue.set(vm.mr, 'availableAutoMergeStrategies', [MTWPS_MERGE_STRATEGY]);
expect(vm.mergeButtonClass).toEqual(inActionClass);
expect(vm.mergeButtonVariant).toEqual('info');
});
it('returns failed class for failed status', () => {
it('returns danger class for failed status', () => {
vm.mr.hasCI = true;
expect(vm.mergeButtonClass).toEqual(failedClass);
expect(vm.mergeButtonVariant).toEqual('danger');
});
});
......
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