Commit fe0df34d authored by Jiaan Louw's avatar Jiaan Louw

Fix rule all branches not using monospace font

Changelog: fixed
EE: true
parent b2a333b7
......@@ -15,7 +15,7 @@ export default {
return protectedBranch?.name || __('All branches');
},
isAllBranches() {
return this.rule.protectedBranches?.length;
return !this.rule.protectedBranches?.length;
},
},
};
......
......@@ -22,9 +22,12 @@ describe('Rule Branches', () => {
wrapper = null;
});
const findBranch = () => wrapper.find('div');
it('displays "All branches" if there are no protected branches', () => {
createComponent();
expect(wrapper.text()).toContain('All branches');
expect(findBranch().text()).toContain('All branches');
expect(findBranch().classes('monospace')).toBe(true);
});
it('displays the branch name of the first protected branch', () => {
......@@ -45,7 +48,8 @@ describe('Rule Branches', () => {
rule,
});
expect(wrapper.text()).toContain('main');
expect(wrapper.text()).not.toContain('hello');
expect(findBranch().text()).toContain('main');
expect(findBranch().text()).not.toContain('hello');
expect(findBranch().classes('monospace')).toBe(false);
});
});
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