import { mount } from '@vue/test-utils'; import Previewer from '@/common/Previewer'; import * as mockedSkinview3d from '../../__mocks__/skinview3d'; import '../../../src/images/textures/steve.png'; jest.mock('../../../src/images/textures/steve.png', () => ''); test('initialize skinview3d', () => { const wrapper = mount(Previewer); expect(wrapper.vm.viewer).toBeInstanceOf(mockedSkinview3d.SkinViewer); expect(wrapper.vm.viewer.camera.position.z).toBe(70); }); test('dispose viewer before destroy', () => { const wrapper = mount(Previewer); wrapper.destroy(); expect(wrapper.vm.viewer.disposed).toBeTrue(); }); test('skin URL should be updated', () => { const wrapper = mount(Previewer); wrapper.setProps({ skin: 'abc' }); expect(wrapper.vm.viewer.skinUrl).toBe('abc'); }); test('cape URL should be updated', () => { const wrapper = mount(Previewer); wrapper.setProps({ cape: 'abc' }); expect(wrapper.vm.viewer.capeUrl).toBe('abc'); }); test('`footer` slot', () => { const wrapper = mount(Previewer, { slots: { footer: '