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

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

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

describe('progress', () => {
  it('has expected default structure', async () => {
    const wrapper = mount(BProgress)

    expect(wrapper.vm).toBeDefined()
    expect(wrapper.element.tagName).toBe('DIV')
    expect(wrapper.classes()).toContain('progress')
    expect(wrapper.text()).toEqual('')
    expect(wrapper.findAll('.progress-bar').length).toBe(1)
    const $bar = wrapper.find('.progress-bar')
    expect($bar.element.tagName).toBe('DIV')
    expect($bar.attributes('role')).toBe('progressbar')
    expect($bar.attributes('aria-valuemin')).toBe('0')
    expect($bar.attributes('aria-valuemax')).toBe('100')
    expect($bar.attributes('aria-valuenow')).toBe('0')
    expect($bar.attributes('style')).toBe('width: 0%;')

    wrapper.destroy()
  })

  it('renders content from default slot', async () => {
    const wrapper = mount(BProgress, {
      slots: {
        default: '<b>foobar</b>'
      }
    })

    expect(wrapper.vm).toBeDefined()
    expect(wrapper.element.tagName).toBe('DIV')
    expect(wrapper.classes()).toContain('progress')
    expect(wrapper.text()).toEqual('foobar')
    expect(wrapper.findAll('.progress-bar').length).toBe(0)
  })

  it('has progress-bar child with expected parameters', async () => {
    const wrapper = mount(BProgress, {
      propsData: {
        value: 25,
        max: 50,
        variant: 'success',
        striped: true,
        animated: true,
        showValue: true
      }
    })

    expect(wrapper.vm).toBeDefined()
    expect(wrapper.element.tagName).toBe('DIV')
    expect(wrapper.classes()).toContain('progress')
    expect(wrapper.findAll('.progress-bar').length).toBe(1)

    const $bar = wrapper.find('.progress-bar')
    expect($bar.element.tagName).toBe('DIV')
    expect($bar.attributes('role')).toBe('progressbar')
    expect($bar.attributes('aria-valuemin')).toBe('0')
    expect($bar.attributes('aria-valuemax')).toBe('50')
    expect($bar.attributes('aria-valuenow')).toBe('25')
    expect($bar.attributes('style')).toBe('width: 50%;')
    expect($bar.classes()).toContain('bg-success')
    expect($bar.classes()).toContain('progress-bar')
    expect($bar.classes()).toContain('progress-bar-striped')
    expect($bar.classes()).toContain('progress-bar-animated')
    expect($bar.classes().length).toBe(4)
    expect($bar.text()).toEqual('25')

    wrapper.destroy()
  })
})

Spamworldpro Mini