Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support ctrl n/p on mac #650

Merged
merged 5 commits into from
Aug 13, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
test: mock platform
  • Loading branch information
wendellhu committed Aug 12, 2021
commit a810424d9a727d54eb7312b3c39be1b3c0116495
3 changes: 3 additions & 0 deletions src/utils/__mocks__/platformUtil.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export function isPlatformMac() {
return true;
}
4 changes: 3 additions & 1 deletion tests/OptionList.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import { injectRunAllTimers } from './utils/common';
import type { OptionsType } from '../src/interface';
import { flattenOptions } from '../src/utils/valueUtil';

jest.mock('../src/utils/platformUtil');

describe('OptionList', () => {
injectRunAllTimers(jest);

Expand Down Expand Up @@ -106,7 +108,7 @@ describe('OptionList', () => {

// this won't pass on test environment which is usually running on Linux
// you can test it with a Mac
xit('special key operation on Mac', () => {
it('special key operation on Mac', () => {
const onActiveValue = jest.fn();
const listRef = React.createRef<RefOptionListProps>();
mount(
Expand Down