-
-
Notifications
You must be signed in to change notification settings - Fork 4
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
Some reablocks components don't work with vitest testing library (Checkbox) #141
Comments
@tigran1100 - Could you make a sample repo? That will help us test it much easier. |
Couldn't push the branch, 403 There are 3 tests (Checkbox.test, ConditionInput.test, SearchInput.test), where only searchInput is working |
Just a new repo would work |
Just want to inform that the problem still exists for 'InlineInput' and 'Select' components on the latest "7.3.6" version, but it fixed the problem for "Checkbox" component Thanks -- ConditionInput: Check the render method of -- Select: Check the render method of |
The problem for "InlineInput" is coming from "react-18-input-autosize" library. AutosizeInput to 'input' in this part of code "node_modules/reablocks/dist/index.js" const InlineInput = forwardRef( The test is passing, but the input is becoming non-resizable. |
@devconn99 - retry now - we redid that component. |
Okay, I will try. |
@tigran1100 - can you retest and let us know if its stil an issue? |
this should be solved now, if its not please reopen. It was the peasky inline input but we redid it. |
I'm submitting a...
Current behavior
When testing reablocks with vitest, some of the components are working fine, some not.
For example: InlineInput
InlineInput.test.tsx`
describe('Test', () => {
it('Should render', () => {
render();
});
});
The error I'm getting`
Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: object
Other components that are throwing error`
Checkbox, Select and probably more
This is how I use Checkbox component`
const TestComponent = () => {
const [checked, setChecked] = useState(false);
return (
<Checkbox
checked={checked}
label="Check me"
onChange={() => setChecked(!checked)}
/>
);
};
describe('Test', () => {
it('Should render', async () => {
render();
});
});
Expected behavior
I expect component to not throw error, when testing with vitest
Minimal reproduction of the problem with instructions
The described components above are giving error, when I try to render them, but some other components from reablocks work just fine, for example Button, Calendar, Card, DateFormat, Menu and more
What is the motivation / use case for changing the behavior?
Environment
The text was updated successfully, but these errors were encountered: