Skip to content

Commit

Permalink
chore: auto merge branches (#39257)
Browse files Browse the repository at this point in the history
chore: merge master into feature
  • Loading branch information
github-actions[bot] committed Dec 5, 2022
2 parents efaefd0 + 7b92c1a commit e85da35
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 8 deletions.
5 changes: 5 additions & 0 deletions components/image/__tests__/image.test.ts
@@ -0,0 +1,5 @@
import { imageDemoTest } from '../../../tests/shared/imageTest';

describe('Image image', () => {
imageDemoTest('image');
});
1 change: 0 additions & 1 deletion components/message/style/index.tsx
Expand Up @@ -71,7 +71,6 @@ const genMessageStyle: GenerateStyle<MessageToken> = (token) => {
...resetComponent(token),
position: 'fixed',
top: marginXS,
insetInlineStart: 0, // affected by ltr or rtl
width: '100%',
pointerEvents: 'none',
zIndex: zIndexPopup,
Expand Down
9 changes: 5 additions & 4 deletions tests/shared/demoTest.tsx
Expand Up @@ -56,10 +56,11 @@ function baseText(doInject: boolean, component: string, options: Options = {}) {
let cssinjsTest = false;

files.forEach((file) => {
let testMethod = options.skip === true ? test.skip : test;
if (Array.isArray(options.skip) && options.skip.some((c) => file.includes(c))) {
testMethod = test.skip;
}
const testMethod =
options.skip === true ||
(Array.isArray(options.skip) && options.skip.some((c) => file.includes(c)))
? test.skip
: test;

if (!doInject && !cssinjsTest && testMethod !== test.skip) {
cssinjsTest = true;
Expand Down
8 changes: 5 additions & 3 deletions tests/shared/imageTest.tsx
Expand Up @@ -65,14 +65,16 @@ type Options = {

// eslint-disable-next-line jest/no-export
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`);

files.forEach((file) => {
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
let Demo = require(`../.${file}`).default;
if (typeof Demo === 'function') {
Expand Down

0 comments on commit e85da35

Please sign in to comment.