Fixed failed tests

pull/3913/head
Tuğçe Küçükoğlu 2023-04-28 17:16:56 +03:00
parent de7c737ba2
commit d0ec2bc110
3 changed files with 5 additions and 7 deletions

View File

@ -1,6 +1,6 @@
<template>
<li v-if="visible()" :class="containerClass()" v-bind="ptm('menuitem')">
<template v-if="!templates.item">
<template v-if="!templates || !templates.item">
<router-link v-if="item.to" v-slot="{ navigate, href, isActive, isExactActive }" :to="item.to" custom>
<a :href="href" :class="linkClass({ isActive, isExactActive })" :aria-current="isCurrentUrl()" @click="onClick($event, navigate)" v-bind="ptm('action')">
<component v-if="templates.itemicon" :is="templates.itemicon" :item="item" class="p-menuitem-icon" />
@ -9,7 +9,7 @@
</a>
</router-link>
<a v-else :href="item.url || '#'" :class="linkClass()" :target="item.target" :aria-current="isCurrentUrl()" @click="onClick" v-bind="ptm('action')">
<component v-if="templates.itemicon" :is="templates.itemicon" :item="item" class="p-menuitem-icon" />
<component v-if="templates && templates.itemicon" :is="templates.itemicon" :item="item" class="p-menuitem-icon" />
<span v-else-if="item.icon" :class="['p-menuitem-icon', item.icon]" v-bind="ptm('icon')" />
<span v-if="item.label" class="p-menuitem-text" v-bind="ptm('label')">{{ label() }}</span>
</a>

View File

@ -79,8 +79,6 @@ describe('Button.vue', () => {
}
});
expect(wrapper.html()).toBe(`<button class="p-button p-component" type="button"><span class="ml-2 font-bold">Default PrimeVue Button</span>
<!--v-if-->
</button>`);
expect(wrapper.html()).toBe(`<button class="p-button p-component" type="button"><span class="ml-2 font-bold">Default PrimeVue Button</span></button>`);
});
});

View File

@ -32,11 +32,11 @@ describe('Password.vue', () => {
});
it('should meter update', async () => {
expect(wrapper.find('.p-password-info').text()).toBe('');
expect(wrapper.find('.p-password-info').text()).toBe('Enter a password');
await wrapper.vm.onKeyUp(event);
expect(wrapper.find('.p-password-info').text()).toBe('');
expect(wrapper.find('.p-password-info').text()).toBe('Weak');
expect(wrapper.find('.p-password-strength').classes()).toContain('weak');
});