Commit c32d1541 authored by Kushal Pandya's avatar Kushal Pandya

Merge branch...

Merge branch '323498-unable-to-edit-squash-commit-message-when-squashing-is-required-in-mrs' into 'master'

Resolve "Unable to edit squash commit message when squashing is required in MRs"

See merge request gitlab-org/gitlab!62851
parents 3d1f0df3 e0ed769c
......@@ -191,7 +191,7 @@ export default {
},
squashIsSelected() {
if (this.glFeatures.mergeRequestWidgetGraphql) {
return this.squashReadOnly ? this.state.squashOnMerge : this.state.squash;
return this.isSquashReadOnly ? this.state.squashOnMerge : this.state.squash;
}
return this.mr.squashIsSelected;
......
......@@ -59,12 +59,17 @@ const createTestService = () => ({
});
let wrapper;
const createComponent = (customConfig = {}) => {
const createComponent = (customConfig = {}, mergeRequestWidgetGraphql = false) => {
wrapper = shallowMount(ReadyToMerge, {
propsData: {
mr: createTestMr(customConfig),
service: createTestService(),
},
provide: {
glFeatures: {
mergeRequestWidgetGraphql,
},
},
});
};
......@@ -673,6 +678,34 @@ describe('ReadyToMerge', () => {
expect(findCommitEditElements().length).toBe(2);
});
it('should have two edit components when squash is enabled and there is more than 1 commit and mergeRequestWidgetGraphql is enabled', async () => {
createComponent(
{
mr: {
commitsCount: 2,
squashIsSelected: true,
enableSquashBeforeMerge: true,
},
},
true,
);
wrapper.setData({
loading: false,
state: {
...createTestMr({}),
userPermissions: {},
squash: true,
mergeable: true,
commitCount: 2,
commitsWithoutMergeCommits: {},
},
});
await wrapper.vm.$nextTick();
expect(findCommitEditElements().length).toBe(2);
});
it('should have one edit components when squash is enabled and there is 1 commit only', () => {
createComponent({
mr: {
......
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