Spamworldpro Mini Shell
Spamworldpro


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/skeleton/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //home/corals/vreg/node_modules/bootstrap-vue/src/components/skeleton/skeleton-wrapper.spec.js
import { mount } from '@vue/test-utils'
import { BSkeletonWrapper } from './skeleton-wrapper'

describe('skeleton-wrapper', () => {
  it('`loading` slot renders when `loading` prop is true', async () => {
    const wrapper = mount(BSkeletonWrapper, {
      propsData: {
        loading: true
      },
      slots: {
        loading: '<span>Loading state</span>'
      }
    })

    expect(wrapper).toBeDefined()
    expect(wrapper.element.tagName).toBe('DIV')
    expect(wrapper.classes()).toContain('b-skeleton-wrapper')

    expect(wrapper.find('span').exists()).toBe(true)
    expect(wrapper.find('span').text()).toBe('Loading state')
    wrapper.destroy()
  })

  it('`default` slot renders when `loading` prop is false', async () => {
    const wrapper = mount(BSkeletonWrapper, {
      propsData: {
        loading: false
      },
      slots: {
        default: '<button>Action</button>'
      }
    })

    expect(wrapper.element.tagName).toBe('BUTTON')
    expect(wrapper.text()).toBe('Action')
  })

  it('root element has correct aria attributes in loading state', async () => {
    const wrapper = mount(BSkeletonWrapper, {
      propsData: {
        loading: true
      }
    })

    expect(wrapper.attributes('aria-busy')).toBe('true')
    expect(wrapper.attributes('aria-live')).toBe('polite')
    expect(wrapper.attributes('role')).toBe('alert')
  })
})

Spamworldpro Mini