Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import { mount } from '@vue/test-utils'
import { createPinia } from 'pinia'
import PrimeVue from 'primevue/config'
import Tag from 'primevue/tag'
import Tooltip from 'primevue/tooltip'
import { describe, expect, it } from 'vitest'
import { createI18n } from 'vue-i18n'

Expand All @@ -22,13 +20,7 @@ describe('ManagerHeader', () => {
const createWrapper = () => {
return mount(ManagerHeader, {
global: {
plugins: [createPinia(), PrimeVue, i18n],
directives: {
tooltip: Tooltip
},
components: {
Tag
}
plugins: [createPinia(), PrimeVue, i18n]
}
})
}
Expand All @@ -41,42 +33,13 @@ describe('ManagerHeader', () => {
)
})

it('displays the legacy manager UI tag', () => {
const wrapper = createWrapper()

const tag = wrapper.find('[data-pc-name="tag"]')
expect(tag.exists()).toBe(true)
expect(tag.text()).toContain(enMessages.manager.legacyManagerUI)
})

it('applies info severity to the tag', () => {
const wrapper = createWrapper()

const tag = wrapper.find('[data-pc-name="tag"]')
expect(tag.classes()).toContain('p-tag-info')
})

it('displays info icon in the tag', () => {
const wrapper = createWrapper()

const icon = wrapper.find('.pi-info-circle')
expect(icon.exists()).toBe(true)
})

it('has cursor-help class on the tag', () => {
const wrapper = createWrapper()

const tag = wrapper.find('[data-pc-name="tag"]')
expect(tag.classes()).toContain('cursor-help')
})

it('has proper structure with flex container', () => {
const wrapper = createWrapper()

const flexContainer = wrapper.find('.flex.justify-end.ml-auto.pr-4')
const flexContainer = wrapper.find('.flex.items-center')
expect(flexContainer.exists()).toBe(true)

const tag = flexContainer.find('[data-pc-name="tag"]')
expect(tag.exists()).toBe(true)
const title = flexContainer.find('h2')
expect(title.exists()).toBe(true)
})
})
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,8 @@
<h2 class="text-lg font-normal text-left">
{{ $t('manager.discoverCommunityContent') }}
</h2>
<div class="flex justify-end ml-auto pr-4 pl-2">
<Tag
v-tooltip.left="$t('manager.legacyManagerUIDescription')"
severity="info"
icon="pi pi-info-circle"
:value="$t('manager.legacyManagerUI')"
class="cursor-help ml-2"
:pt="{
root: { class: 'text-xs' }
}"
/>
</div>
</div>
</div>
</template>

<script setup lang="ts">
import Tag from 'primevue/tag'
</script>
<script setup lang="ts"></script>