Created
August 27, 2020 17:22
-
-
Save nucab/edd44dd4a5bc226c2aa924cd37090e33 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jest.mock('antd', () => { | |
const antd = jest.requireActual('antd'); | |
const Select = ({ children, onChange }: any) => ( | |
<select | |
data-testid="entries-select" | |
onChange={e => onChange(e.target.value)} | |
> | |
{children} | |
</select> | |
); | |
Select.Option = ({ children, ...otherProps }: any) => ( | |
<option | |
data-testid={`${children![0].toString()}-entries`} | |
{...otherProps} | |
>{`${children![0].toString()} Entries`}</option> | |
); | |
return { | |
...antd, | |
Select, | |
}; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment