mirror of https://github.com/alibaba/ice.git
20 lines
452 B
TypeScript
20 lines
452 B
TypeScript
/**
|
|
* @vitest-environment jsdom
|
|
*/
|
|
|
|
import { expect, it, describe } from 'vitest';
|
|
import { render } from '@testing-library/react';
|
|
import createFactory from '../src/create-factory';
|
|
|
|
describe('createFactory', () => {
|
|
it('basic', () => {
|
|
const factory = createFactory('div');
|
|
const div = factory(null, 'div node');
|
|
|
|
const wrapper = render(div);
|
|
let res = wrapper.getAllByText('div node');
|
|
|
|
expect(res.length).toBe(1);
|
|
});
|
|
});
|