Commit e0ed769c authored by jboyson's avatar jboyson

Fix reference to `isSquashReadOnly`

Changelog: fixed
parent 7a406c41
......@@ -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