![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/vreg/node_modules/bootstrap-vue/src/components/navbar/ |
import { mount } from '@vue/test-utils' import { BNavbarNav } from './navbar-nav' describe('navbar-nav', () => { it('default has tag "ul"', async () => { const wrapper = mount(BNavbarNav) expect(wrapper.element.tagName).toBe('UL') wrapper.destroy() }) it('default has class "navbar-nav"', async () => { const wrapper = mount(BNavbarNav) expect(wrapper.classes()).toContain('navbar-nav') expect(wrapper.classes().length).toBe(1) wrapper.destroy() }) it('accepts custom tag', async () => { const wrapper = mount(BNavbarNav, { context: { props: { tag: 'div' } } }) expect(wrapper.element.tagName).toBe('DIV') expect(wrapper.classes()).toContain('navbar-nav') expect(wrapper.classes().length).toBe(1) wrapper.destroy() }) it('has class "nav-fill" when fill=true', async () => { const wrapper = mount(BNavbarNav, { context: { props: { fill: true } } }) expect(wrapper.classes()).toContain('nav-fill') expect(wrapper.classes()).toContain('navbar-nav') expect(wrapper.classes().length).toBe(2) wrapper.destroy() }) it('has class "nav-justified" when justified=true', async () => { const wrapper = mount(BNavbarNav, { context: { props: { justified: true } } }) expect(wrapper.classes()).toContain('nav-justified') expect(wrapper.classes()).toContain('navbar-nav') expect(wrapper.classes().length).toBe(2) wrapper.destroy() }) it('applies alignment correctly', async () => { const wrapper = mount(BNavbarNav, { context: { props: { align: 'center' } } }) expect(wrapper.classes()).toContain('justify-content-center') expect(wrapper.classes()).toContain('navbar-nav') expect(wrapper.classes().length).toBe(2) wrapper.destroy() }) it('has class "small" when small=true', async () => { const wrapper = mount(BNavbarNav, { context: { props: { small: true } } }) expect(wrapper.classes()).toContain('small') expect(wrapper.classes()).toContain('navbar-nav') expect(wrapper.classes().length).toBe(2) wrapper.destroy() }) it('has class "small" when small=true', async () => { const wrapper = mount(BNavbarNav, { context: { props: { small: true } } }) expect(wrapper.classes()).toContain('small') expect(wrapper.classes()).toContain('navbar-nav') expect(wrapper.classes().length).toBe(2) wrapper.destroy() }) })