<commit_before>import { shallow } from '@vue/test-utils'
import BCollapse from '@components/collapse/Collapse'

describe('BCollapse', () => {
    it('is called', () => {
        const wrapper = shallow(BCollapse)
        expect(wrapper.name()).toBe('BCollapse')
        expect(wrapper.isVueInstance()).toBeTruthy()
    })

    it('default props and vm', () => {
        const wrapper = shallow(BCollapse)
        expect(wrapper.props().open).toBe(true)
        expect(wrapper.vm.animation).toBe('fade')
        expect(wrapper.vm.isOpen).toBe(true)
    })

    it('open prop to false', () => {
        const wrapper = shallow(BCollapse, {
            propsData: {
                open: false
            }
        })
        expect(wrapper.props().open).toBe(false)
        expect(wrapper.vm.isOpen).toBe(false)
    })

    it('should call toggle method', async () => {
        const wrapper = shallow(BCollapse, {
            propsData: {
                open: false
            }
        })
        expect(wrapper.find('.collapse-content').isVisible()).toBe(false)
        wrapper.vm.toggle()
        await wrapper.vm.$nextTick()
        expect(wrapper.vm.isOpen).toBe(true)
        expect(wrapper.find('.collapse-content').isVisible()).toBe(true)
    })
    
    it('should emit a click event', () => {
        const wrapper = shallow(BCollapse, {
            propsData: {
                open: false
            }
        })
        expect(wrapper.find('.collapse-content').isVisible()).toBe(false)
        const updateOpen = jest.fn()
        wrapper.vm.$on('update:open', updateOpen)
        wrapper.find('.collapse-trigger').trigger('click')
        expect(updateOpen).toHaveBeenCalledTimes(1)
        expect(wrapper.vm.isOpen).toBe(true)
        expect(wrapper.find('.collapse-content').isVisible()).toBe(true)
    })

    it('should have trigger slot', () => {
        const triggerSlot = '<strong> Header </strong>'
        const wrapper = shallow(BCollapse, {
            slots: {
                trigger: triggerSlot
            }
        })
        expect(wrapper.find('.collapse-trigger').element.innerHTML).toBe(triggerSlot)
    })
<commit_msg>Fix lint Collapse component test<commit_after>import { shallow } from '@vue/test-utils'
import BCollapse from '@components/collapse/Collapse'

describe('BCollapse', () => {
    it('is called', () => {
        const wrapper = shallow(BCollapse)
        expect(wrapper.name()).toBe('BCollapse')
        expect(wrapper.isVueInstance()).toBeTruthy()
    })

    it('default props and vm', () => {
        const wrapper = shallow(BCollapse)
        expect(wrapper.props().open).toBe(true)
        expect(wrapper.vm.animation).toBe('fade')
        expect(wrapper.vm.isOpen).toBe(true)
    })

    it('open prop to false', () => {
        const wrapper = shallow(BCollapse, {
            propsData: {
                open: false
            }
        })
        expect(wrapper.props().open).toBe(false)
        expect(wrapper.vm.isOpen).toBe(false)
    })

    it('should call toggle method', async () => {
        const wrapper = shallow(BCollapse, {
            propsData: {
                open: false
            }
        })
        expect(wrapper.find('.collapse-content').isVisible()).toBe(false)
        wrapper.vm.toggle()
        await wrapper.vm.$nextTick()
        expect(wrapper.vm.isOpen).toBe(true)
        expect(wrapper.find('.collapse-content').isVisible()).toBe(true)
    })

    it('should emit a click event', () => {
        const wrapper = shallow(BCollapse, {
            propsData: {
                open: false
            }
        })
        expect(wrapper.find('.collapse-content').isVisible()).toBe(false)
        const updateOpen = jest.fn()
        wrapper.vm.$on('update:open', updateOpen)
        wrapper.find('.collapse-trigger').trigger('click')
        expect(updateOpen).toHaveBeenCalledTimes(1)
        expect(wrapper.vm.isOpen).toBe(true)
        expect(wrapper.find('.collapse-content').isVisible()).toBe(true)
    })

    it('should have trigger slot', () => {
        const triggerSlot = '<strong> Header </strong>'
        const wrapper = shallow(BCollapse, {
            slots: {
                trigger: triggerSlot
            }
        })
        expect(wrapper.find('.collapse-trigger').element.innerHTML).toBe(triggerSlot)
    })

{'fraction_non_alphanumeric': 0.1523897483260217, 'fraction_numerical': 0.0004617871161394597, 'mean_word_length': 2.1876379690949226, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2126389', 'n_tokens_mistral': 1206, 'n_tokens_neox': 1190, 'n_words': 188}