mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-13 07:39:10 +08:00
commit
e85da35ee2
5
components/image/__tests__/image.test.ts
Normal file
5
components/image/__tests__/image.test.ts
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
import { imageDemoTest } from '../../../tests/shared/imageTest';
|
||||||
|
|
||||||
|
describe('Image image', () => {
|
||||||
|
imageDemoTest('image');
|
||||||
|
});
|
@ -71,7 +71,6 @@ const genMessageStyle: GenerateStyle<MessageToken> = (token) => {
|
|||||||
...resetComponent(token),
|
...resetComponent(token),
|
||||||
position: 'fixed',
|
position: 'fixed',
|
||||||
top: marginXS,
|
top: marginXS,
|
||||||
insetInlineStart: 0, // affected by ltr or rtl
|
|
||||||
width: '100%',
|
width: '100%',
|
||||||
pointerEvents: 'none',
|
pointerEvents: 'none',
|
||||||
zIndex: zIndexPopup,
|
zIndex: zIndexPopup,
|
||||||
|
@ -56,10 +56,11 @@ function baseText(doInject: boolean, component: string, options: Options = {}) {
|
|||||||
let cssinjsTest = false;
|
let cssinjsTest = false;
|
||||||
|
|
||||||
files.forEach((file) => {
|
files.forEach((file) => {
|
||||||
let testMethod = options.skip === true ? test.skip : test;
|
const testMethod =
|
||||||
if (Array.isArray(options.skip) && options.skip.some((c) => file.includes(c))) {
|
options.skip === true ||
|
||||||
testMethod = test.skip;
|
(Array.isArray(options.skip) && options.skip.some((c) => file.includes(c)))
|
||||||
}
|
? test.skip
|
||||||
|
: test;
|
||||||
|
|
||||||
if (!doInject && !cssinjsTest && testMethod !== test.skip) {
|
if (!doInject && !cssinjsTest && testMethod !== test.skip) {
|
||||||
cssinjsTest = true;
|
cssinjsTest = true;
|
||||||
|
@ -65,14 +65,16 @@ type Options = {
|
|||||||
|
|
||||||
// eslint-disable-next-line jest/no-export
|
// eslint-disable-next-line jest/no-export
|
||||||
export function imageDemoTest(component: string, options: Options = {}) {
|
export function imageDemoTest(component: string, options: Options = {}) {
|
||||||
let testMethod = options.skip === true ? describe.skip : describe;
|
let describeMethod = options.skip === true ? describe.skip : describe;
|
||||||
const files = glob.sync(`./components/${component}/demo/*.tsx`);
|
const files = glob.sync(`./components/${component}/demo/*.tsx`);
|
||||||
|
|
||||||
files.forEach((file) => {
|
files.forEach((file) => {
|
||||||
if (Array.isArray(options.skip) && options.skip.some((c) => file.includes(c))) {
|
if (Array.isArray(options.skip) && options.skip.some((c) => file.includes(c))) {
|
||||||
testMethod = test.skip;
|
describeMethod = describe.skip;
|
||||||
|
} else {
|
||||||
|
describeMethod = describe;
|
||||||
}
|
}
|
||||||
testMethod(`Test ${file} image`, () => {
|
describeMethod(`Test ${file} image`, () => {
|
||||||
// eslint-disable-next-line global-require,import/no-dynamic-require
|
// eslint-disable-next-line global-require,import/no-dynamic-require
|
||||||
let Demo = require(`../.${file}`).default;
|
let Demo = require(`../.${file}`).default;
|
||||||
if (typeof Demo === 'function') {
|
if (typeof Demo === 'function') {
|
||||||
|
Loading…
Reference in New Issue
Block a user