Skip to content

Commit

Permalink
refactor[Wave]: CC => FC (#39705)
Browse files Browse the repository at this point in the history
* fix

* refactor[Wave]: CC => FC

* fix lint

* fix

* fix

* fix

* add test case

* add test case

* fix test

* fix test

* test case

* add test case

* fix

* fix

* fix

* fix

* raname

* fix

* test case

* test case

* test case

* fix test

* test case

* refactor: Use React way

* test: coverage

* chore: clean up

* rerun fail ci

* fix: React 17 error

* test: fix test case

* test: fix test case

* fix borderRadius

* test: fix test case

* chore: clean up

* chore: clean up

Co-authored-by: 二货机器人 <smith3816@gmail.com>
  • Loading branch information
2 people authored and yoyo837 committed Dec 31, 2022
1 parent 365288a commit 4f16966
Show file tree
Hide file tree
Showing 15 changed files with 414 additions and 671 deletions.
34 changes: 0 additions & 34 deletions components/_util/__tests__/util.test.tsx
@@ -1,10 +1,8 @@
/* eslint-disable class-methods-use-this */
import KeyCode from 'rc-util/lib/KeyCode';
import raf from 'rc-util/lib/raf';
import React from 'react';
import { waitFakeTimer, render, fireEvent } from '../../../tests/utils';
import getDataOrAriaProps from '../getDataOrAriaProps';
import delayRaf from '../raf';
import { isStyleSupport } from '../styleChecker';
import throttleByAnimationFrame from '../throttleByAnimationFrame';
import TransButton from '../transButton';
Expand Down Expand Up @@ -99,38 +97,6 @@ describe('Test utils function', () => {
});
});

it('delayRaf', (done) => {
jest.useRealTimers();

let bamboo = false;
delayRaf(() => {
bamboo = true;
}, 3);

// Do nothing, but insert in the frame
// https://github.com/ant-design/ant-design/issues/16290
delayRaf(() => {}, 3);

// Variable bamboo should be false in frame 2 but true in frame 4
raf(() => {
expect(bamboo).toBe(false);

// Frame 2
raf(() => {
expect(bamboo).toBe(false);

// Frame 3
raf(() => {
// Frame 4
raf(() => {
expect(bamboo).toBe(true);
done();
});
});
});
});
});

describe('TransButton', () => {
it('can be focus/blur', () => {
const ref = React.createRef<HTMLDivElement>();
Expand Down

0 comments on commit 4f16966

Please sign in to comment.