Skip to content

Commit 25502f9

Browse files
christian-byrnegithub-actions
authored andcommitted
Fix errors from rebase (removed Tag component import and duplicated imports in api.ts) (#4608)
Co-authored-by: github-actions <[email protected]>
1 parent 0df7254 commit 25502f9

File tree

3 files changed

+98
-10
lines changed

3 files changed

+98
-10
lines changed
2.57 KB
Loading
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
import { mount } from '@vue/test-utils'
2+
import { createPinia } from 'pinia'
3+
import PrimeVue from 'primevue/config'
4+
import Tag from 'primevue/tag'
5+
import Tooltip from 'primevue/tooltip'
6+
import { describe, expect, it } from 'vitest'
7+
import { createI18n } from 'vue-i18n'
8+
9+
import enMessages from '@/locales/en/main.json'
10+
11+
import ManagerHeader from './ManagerHeader.vue'
12+
13+
const i18n = createI18n({
14+
legacy: false,
15+
locale: 'en',
16+
messages: {
17+
en: enMessages
18+
}
19+
})
20+
21+
describe('ManagerHeader', () => {
22+
const createWrapper = () => {
23+
return mount(ManagerHeader, {
24+
global: {
25+
plugins: [createPinia(), PrimeVue, i18n],
26+
directives: {
27+
tooltip: Tooltip
28+
},
29+
components: {
30+
Tag
31+
}
32+
}
33+
})
34+
}
35+
36+
it('renders the component title', () => {
37+
const wrapper = createWrapper()
38+
39+
expect(wrapper.find('h2').text()).toBe(
40+
enMessages.manager.discoverCommunityContent
41+
)
42+
})
43+
44+
it('displays the legacy manager UI tag', () => {
45+
const wrapper = createWrapper()
46+
47+
const tag = wrapper.find('[data-pc-name="tag"]')
48+
expect(tag.exists()).toBe(true)
49+
expect(tag.text()).toContain(enMessages.manager.legacyManagerUI)
50+
})
51+
52+
it('applies info severity to the tag', () => {
53+
const wrapper = createWrapper()
54+
55+
const tag = wrapper.find('[data-pc-name="tag"]')
56+
expect(tag.classes()).toContain('p-tag-info')
57+
})
58+
59+
it('displays info icon in the tag', () => {
60+
const wrapper = createWrapper()
61+
62+
const icon = wrapper.find('.pi-info-circle')
63+
expect(icon.exists()).toBe(true)
64+
})
65+
66+
it('has cursor-help class on the tag', () => {
67+
const wrapper = createWrapper()
68+
69+
const tag = wrapper.find('[data-pc-name="tag"]')
70+
expect(tag.classes()).toContain('cursor-help')
71+
})
72+
73+
it('has proper structure with flex container', () => {
74+
const wrapper = createWrapper()
75+
76+
const flexContainer = wrapper.find('.flex.justify-end.ml-auto.pr-4')
77+
expect(flexContainer.exists()).toBe(true)
78+
79+
const tag = flexContainer.find('[data-pc-name="tag"]')
80+
expect(tag.exists()).toBe(true)
81+
})
82+
})

src/components/dialog/content/manager/ManagerHeader.vue

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,22 @@
44
<h2 class="text-lg font-normal text-left">
55
{{ $t('manager.discoverCommunityContent') }}
66
</h2>
7-
<Tag
8-
v-tooltip.left="$t('manager.legacyManagerUIDescription')"
9-
severity="info"
10-
icon="pi pi-info-circle"
11-
:value="$t('manager.legacyManagerUI')"
12-
class="cursor-help"
13-
:pt="{
14-
root: { class: 'text-xs' }
15-
}"
16-
/>
7+
<div class="flex justify-end ml-auto pr-4">
8+
<Tag
9+
v-tooltip.left="$t('manager.legacyManagerUIDescription')"
10+
severity="info"
11+
icon="pi pi-info-circle"
12+
:value="$t('manager.legacyManagerUI')"
13+
class="cursor-help"
14+
:pt="{
15+
root: { class: 'text-xs' }
16+
}"
17+
/>
18+
</div>
1719
</div>
1820
</div>
1921
</template>
22+
23+
<script setup lang="ts">
24+
import Tag from 'primevue/tag'
25+
</script>

0 commit comments

Comments
 (0)