diff options
author | Enrique Alcantara <ealcantara@gitlab.com> | 2019-04-16 10:56:07 -0400 |
---|---|---|
committer | Enrique Alcantara <ealcantara@gitlab.com> | 2019-04-18 08:27:14 -0400 |
commit | 5a7b8666ca718548cbe1c0bfe82190af6cf3bd57 (patch) | |
tree | 5170b459475ac34149acaa3a1433dc7d815f2d1f /spec/frontend | |
parent | 8f6ec252a3a440687740925ec5b01d895fe3e2c0 (diff) | |
download | gitlab-ce-5a7b8666ca718548cbe1c0bfe82190af6cf3bd57.tar.gz |
Show uninstall button when app is uninstallable
- Create empty uninstall_button component.
- Add uninstallable property to application_row component.
- Display Uninstall button if app is uninstallable and it
is installed.
Diffstat (limited to 'spec/frontend')
-rw-r--r-- | spec/frontend/clusters/components/application_row_spec.js | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/spec/frontend/clusters/components/application_row_spec.js b/spec/frontend/clusters/components/application_row_spec.js index 1e4e814b5e1..038d2be9e98 100644 --- a/spec/frontend/clusters/components/application_row_spec.js +++ b/spec/frontend/clusters/components/application_row_spec.js @@ -114,11 +114,12 @@ describe('Application Row', () => { expect(vm.installButtonDisabled).toEqual(true); }); - it('has disabled "Installed" when application is installed', () => { + it('has disabled "Installed" when application is installed and not uninstallable', () => { vm = mountComponent(ApplicationRow, { ...DEFAULT_APPLICATION_STATE, status: APPLICATION_STATUS.INSTALLED, installed: true, + uninstallable: false, }); expect(vm.installButtonLabel).toEqual('Installed'); @@ -126,6 +127,18 @@ describe('Application Row', () => { expect(vm.installButtonDisabled).toEqual(true); }); + it('hides when application is installed and uninstallable', () => { + vm = mountComponent(ApplicationRow, { + ...DEFAULT_APPLICATION_STATE, + status: APPLICATION_STATUS.INSTALLED, + installed: true, + uninstallable: true, + }); + const installBtn = vm.$el.querySelector('.js-cluster-application-install-button'); + + expect(installBtn).toBe(null); + }); + it('has enabled "Install" when APPLICATION_STATUS.ERROR', () => { vm = mountComponent(ApplicationRow, { ...DEFAULT_APPLICATION_STATE, @@ -198,6 +211,19 @@ describe('Application Row', () => { }); }); + describe('Uninstall button', () => { + it('displays button when app is installed and uninstallable', () => { + vm = mountComponent(ApplicationRow, { + ...DEFAULT_APPLICATION_STATE, + installed: true, + uninstallable: true, + }); + const uninstallButton = vm.$el.querySelector('.js-cluster-application-uninstall-button'); + + expect(uninstallButton).toBeTruthy(); + }); + }); + describe('Upgrade button', () => { it('has indeterminate state on page load', () => { vm = mountComponent(ApplicationRow, { |