刘光辉
6 小时以前 cf11e63b659afcc9792ab3e395f1b45d844431a8
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import { shallowMount } from '@vue/test-utils';
 
import { describe, expect, it, vi } from 'vitest';
 
import SourcePage from '../index.vue';
import pageSource from '../index.vue?raw';
 
vi.mock('../../fields/SourceWorkspace.vue', () => ({
  default: {
    name: 'SourceWorkspace',
    template: '<div data-test="source-workspace" />',
  },
}));
 
describe('eLN LIMS source page', () => {
  it('hosts source maintenance in a standalone page workspace', () => {
    const wrapper = shallowMount(SourcePage);
 
    expect(pageSource).toContain('<div class="jnpf-content-wrapper">');
    expect(wrapper.findComponent({ name: 'SourceWorkspace' }).exists()).toBe(true);
    expect(wrapper.findComponent({ name: 'SourceWorkspace' }).props('fieldDataType')).toBeUndefined();
    expect(pageSource).not.toContain('BasicModal');
    expect(pageSource).not.toContain('BasicDrawer');
  });
});