Application name shouldn't be clickable on an environments page

Fixes #9
This commit is contained in:
Oliver Davies 2019-04-10 12:17:55 +01:00
parent 9d04ebaa84
commit e544595e7c
2 changed files with 8 additions and 7 deletions

View file

@ -5,7 +5,7 @@
<div class="flex flex-col-reverse"> <div class="flex flex-col-reverse">
<span class="text-gray-700 uppercase text-sm">Organization</span> <span class="text-gray-700 uppercase text-sm">Organization</span>
<span v-if="!selectedOrganisation" class="font-bold block mb-1">All</span> <span v-if="!selectedOrganisation" class="font-bold block mb-1">All</span>
<router-link v-else :to="{name: 'applications'}" class="font-bold block mb-1 hover:text-blue-400 whitespace-no-wrap" v-text="selectedOrganisation"></router-link> <router-link v-else :to="{ name: 'applications' }" class="font-bold block mb-1 hover:text-blue-400 whitespace-no-wrap" v-text="selectedOrganisation"></router-link>
</div> </div>
<svg class="ml-3" xmlns="http://www.w3.org/2000/svg" width="20" height="20"><path d="M5.94 19.73L15.6 10 5.94.27A.88.88 0 0 0 5.3 0a.89.89 0 0 0-.65 1.51L13.06 10l-8.41 8.49a.89.89 0 0 0 1.29 1.24z"/></svg> <svg class="ml-3" xmlns="http://www.w3.org/2000/svg" width="20" height="20"><path d="M5.94 19.73L15.6 10 5.94.27A.88.88 0 0 0 5.3 0a.89.89 0 0 0-.65 1.51L13.06 10l-8.41 8.49a.89.89 0 0 0 1.29 1.24z"/></svg>
</li> </li>
@ -14,7 +14,8 @@
<div class="flex flex-col-reverse"> <div class="flex flex-col-reverse">
<span class="text-gray-700 uppercase text-sm">Application</span> <span class="text-gray-700 uppercase text-sm">Application</span>
<span v-if="!selectedApplication" class="font-bold block mb-1">All</span> <span v-if="!selectedApplication" class="font-bold block mb-1">All</span>
<router-link v-else :to="{name: 'environments'}" class="font-bold block mb-1 hover:text-blue-400 whitespace-no-wrap" v-text="selectedApplication"></router-link> <span v-else-if="!selectedEnvironment" class="font-bold block mb-1" v-text="selectedApplication"></span>
<router-link v-else :to="{ name: 'environments' }" class="font-bold block mb-1 hover:text-blue-400 whitespace-no-wrap" v-text="selectedApplication"></router-link>
</div> </div>
<svg class="ml-3" xmlns="http://www.w3.org/2000/svg" width="20" height="20"><path d="M5.94 19.73L15.6 10 5.94.27A.88.88 0 0 0 5.3 0a.89.89 0 0 0-.65 1.51L13.06 10l-8.41 8.49a.89.89 0 0 0 1.29 1.24z"/></svg> <svg class="ml-3" xmlns="http://www.w3.org/2000/svg" width="20" height="20"><path d="M5.94 19.73L15.6 10 5.94.27A.88.88 0 0 0 5.3 0a.89.89 0 0 0-.65 1.51L13.06 10l-8.41 8.49a.89.89 0 0 0 1.29 1.24z"/></svg>
</li> </li>
@ -42,7 +43,7 @@ export default {
computed: { computed: {
selectedOrganisation: function () { selectedOrganisation: function () {
if (!this.application) { if (!this.application) {
return 'All' return null
} }
return 'Rebuilding Acquia' return 'Rebuilding Acquia'
@ -62,7 +63,7 @@ export default {
} }
if (!this.environment) { if (!this.environment) {
return 'All' return null
} }
return this.environment.name return this.environment.name

View file

@ -1,14 +1,14 @@
import AppBreadcrumb from '@/components/AppBreadcrumb.vue' import AppBreadcrumb from '@/components/AppBreadcrumb.vue'
import { RouterLinkStub, shallowMount } from '@vue/test-utils' import { RouterLinkStub, shallowMount } from '@vue/test-utils'
const stubs = { const stubs = {
RouterLink: RouterLinkStub RouterLink: RouterLinkStub
} }
test('it returns default values', () => { test('it returns default values', () => {
const wrapper = shallowMount(AppBreadcrumb, { stubs }) const wrapper = shallowMount(AppBreadcrumb, { stubs })
expect(wrapper.vm.selectedOrganisation).toBe('All') expect(wrapper.vm.selectedOrganisation).toBe(null)
expect(wrapper.vm.selectedApplication).toBe(null) expect(wrapper.vm.selectedApplication).toBe(null)
expect(wrapper.vm.selectedEnvironment).toBe(null) expect(wrapper.vm.selectedEnvironment).toBe(null)
}) })
@ -25,7 +25,7 @@ test('it returns the organisation and application names', () => {
expect(wrapper.vm.selectedOrganisation).toBe('Rebuilding Acquia') expect(wrapper.vm.selectedOrganisation).toBe('Rebuilding Acquia')
expect(wrapper.vm.selectedApplication).toBe('Oliver Davies') expect(wrapper.vm.selectedApplication).toBe('Oliver Davies')
expect(wrapper.vm.selectedEnvironment).toBe('All') expect(wrapper.vm.selectedEnvironment).toBe(null)
}) })
test('it returns the environment name', () => { test('it returns the environment name', () => {