-
Couldn't load subscription status.
- Fork 8
feat: v2 dropdown #76
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
Conversation
| }); | ||
| const itemFoo = getByText('Item Foo'); | ||
| const itemBar = getByText('Item Bar'); | ||
| expect(itemFoo.classList.contains('is-active')).toBeTruthy(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be better to use .toBe(true) if you are expecting this to actually be true?
| const itemFoo = getByText('Item Foo'); | ||
| const itemBar = getByText('Item Bar'); | ||
| expect(itemFoo.classList.contains('is-active')).toBeTruthy(); | ||
| expect(itemBar.classList.contains('is-active')).toBeFalsy(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same for .toBe(false)
|
|
||
| ```jsx | ||
| import { InputList, InputListItem } from '@lightelligence/react'; | ||
| const onClick = (value) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| const onClick = (value) => { | |
| const onChange = (value) => { |
| }); | ||
|
|
||
| const component = getByText('Component'); | ||
| expect(component.classList.contains('myClass')).toBeTruthy(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| expect(component.classList.contains('myClass')).toBeTruthy(); | |
| expect(component.classList.contains('myClass')).toBe(true); |
| {selectedElement.props.children} | ||
| </div> | ||
| )} | ||
| <div className={classnames(olt.V2DropdownContent)}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The dropdown content is rendered behind the code field in the guide.
| ], | ||
| }); | ||
| const component = getByTestId('component'); | ||
| expect(component.classList.contains('myClass')).toBeTruthy(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| expect(component.classList.contains('myClass')).toBeTruthy(); | |
| expect(component.classList.contains('myClass')).toBe(true); |
| }); | ||
| const component = getByTestId('component'); | ||
| fireEvent.click(component); | ||
| expect(component.classList.contains('is-open')).toBeTruthy(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| expect(component.classList.contains('is-open')).toBeTruthy(); | |
| expect(component.classList.contains('is-open')).toBe(true); |
| fireEvent.click(component); | ||
| expect(component.classList.contains('is-open')).toBeTruthy(); | ||
| fireEvent.click(component); | ||
| expect(component.classList.contains('is-open')).toBeFalsy(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| expect(component.classList.contains('is-open')).toBeFalsy(); | |
| expect(component.classList.contains('is-open')).toBe(false); |
| ); | ||
| const selectedElement = selectedChild && React.cloneElement(selectedChild); | ||
|
|
||
| return ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are a couple of components that allow passing props to their children (e.g. Card with contentProps, actionProps, headerProps, editProps, ...) should we allow that consistently for all components?
No description provided.