Commit 9cafd899 authored by mfluharty's avatar mfluharty Committed by Enrique Alcántara

Make gl-button the main element

Move modal inside of button so that button can be grouped
parent 00c6a02d
...@@ -90,11 +90,8 @@ export default { ...@@ -90,11 +90,8 @@ export default {
</script> </script>
<template> <template>
<span>
<gl-button :disabled="!canLock" :loading="lockLoading" @click="showModal"> <gl-button :disabled="!canLock" :loading="lockLoading" @click="showModal">
{{ lockButtonTitle }} {{ lockButtonTitle }}
</gl-button>
<gl-modal <gl-modal
modal-id="lock-file-modal" modal-id="lock-file-modal"
:visible="isModalVisible" :visible="isModalVisible"
...@@ -108,5 +105,5 @@ export default { ...@@ -108,5 +105,5 @@ export default {
{{ lockConfirmText }} {{ lockConfirmText }}
</p> </p>
</gl-modal> </gl-modal>
</span> </gl-button>
</template> </template>
...@@ -59,10 +59,10 @@ describe('LockButton component', () => { ...@@ -59,10 +59,10 @@ describe('LockButton component', () => {
isLocked | label isLocked | label
${false} | ${'Lock'} ${false} | ${'Lock'}
${true} | ${'Unlock'} ${true} | ${'Unlock'}
`('renders the correct button labels', ({ isLocked, label }) => { `('renders the $label button label', ({ isLocked, label }) => {
createComponent({ isLocked }); createComponent({ isLocked });
expect(findLockButton().text()).toBe(label); expect(findLockButton().text()).toContain(label);
}); });
it('passes the correct prop if lockLoading is set to true', async () => { it('passes the correct prop if lockLoading is set to true', async () => {
......
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