Commit a97692bd authored by Kushal Pandya's avatar Kushal Pandya

Merge branch '37743-refactor-mr-widget-read-to-merge-spec' into 'master'

Refactor spec file to use the same wrapper name to ensure consistency

Closes #37743

See merge request gitlab-org/gitlab!22181
parents 8f23a3bb a4aa080e
...@@ -634,20 +634,18 @@ describe('ReadyToMerge', () => { ...@@ -634,20 +634,18 @@ describe('ReadyToMerge', () => {
}); });
describe('when user can merge and can delete branch', () => { describe('when user can merge and can delete branch', () => {
let customVm;
beforeEach(() => { beforeEach(() => {
customVm = createComponent({ vm = createComponent({
mr: { canRemoveSourceBranch: true }, mr: { canRemoveSourceBranch: true },
}); });
}); });
it('isRemoveSourceBranchButtonDisabled should be false', () => { it('isRemoveSourceBranchButtonDisabled should be false', () => {
expect(customVm.isRemoveSourceBranchButtonDisabled).toBe(false); expect(vm.isRemoveSourceBranchButtonDisabled).toBe(false);
}); });
it('should be enabled in rendered output', () => { it('removed source branch should be enabled in rendered output', () => {
const checkboxElement = customVm.$el.querySelector('#remove-source-branch-input'); const checkboxElement = vm.$el.querySelector('#remove-source-branch-input');
expect(checkboxElement).not.toBeNull(); expect(checkboxElement).not.toBeNull();
}); });
...@@ -926,22 +924,36 @@ describe('ReadyToMerge', () => { ...@@ -926,22 +924,36 @@ describe('ReadyToMerge', () => {
}); });
describe('Commit message area', () => { describe('Commit message area', () => {
it('when using merge commits, should show "Modify commit message" button', () => { describe('when using merge commits', () => {
const customVm = createComponent({ beforeEach(() => {
mr: { ffOnlyEnabled: false }, vm = createComponent({
mr: { ffOnlyEnabled: false },
});
});
it('should not show fast forward message', () => {
expect(vm.$el.querySelector('.mr-fast-forward-message')).toBeNull();
}); });
expect(customVm.$el.querySelector('.mr-fast-forward-message')).toBeNull(); it('should show "Modify commit message" button', () => {
expect(customVm.$el.querySelector('.js-modify-commit-message-button')).toBeDefined(); expect(vm.$el.querySelector('.js-modify-commit-message-button')).toBeDefined();
});
}); });
it('when fast-forward merge is enabled, only show fast-forward message', () => { describe('when fast-forward merge is enabled', () => {
const customVm = createComponent({ beforeEach(() => {
mr: { ffOnlyEnabled: true }, vm = createComponent({
mr: { ffOnlyEnabled: true },
});
});
it('should show fast forward message', () => {
expect(vm.$el.querySelector('.mr-fast-forward-message')).toBeDefined();
}); });
expect(customVm.$el.querySelector('.mr-fast-forward-message')).toBeDefined(); it('should not show "Modify commit message" button', () => {
expect(customVm.$el.querySelector('.js-modify-commit-message-button')).toBeNull(); expect(vm.$el.querySelector('.js-modify-commit-message-button')).toBeNull();
});
}); });
}); });
......
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