@cainiaofe/cn-ui-m
Version:
16 lines (15 loc) • 726 B
JavaScript
import React from 'react';
import { render, screen } from '@testing-library/react';
import { CnList, CnListItem } from '../index';
describe('CnList', function () {
test('renders without error', function () {
var getByText = render(React.createElement(CnList, null,
React.createElement(CnListItem, { title: "\u4E3B\u6807\u9898" }))).getByText;
expect(getByText('主标题')).toBeInTheDocument();
});
test('renders custom content correctly', function () {
render(React.createElement(CnList, null,
React.createElement("div", { "data-testid": "custom-content" }, "Custom Content")));
expect(screen.getByTestId('custom-content')).toBeInTheDocument();
});
});