Live location sharing: maximised view sidebar container (#8360)
* add h4 Signed-off-by: Kerry Archibald <kerrya@element.io> * add mixin to clear list style Signed-off-by: Kerry Archibald <kerrya@element.io> * add basic sidebar container Signed-off-by: Kerry Archibald <kerrya@element.io> * open list view button on beaconviewdialog Signed-off-by: Kerry Archibald <kerrya@element.io> * update tests for new utils Signed-off-by: Kerry Archibald <kerrya@element.io>
This commit is contained in:
parent
a471742e97
commit
e45cd39906
14 changed files with 307 additions and 3 deletions
|
@ -151,4 +151,43 @@ describe('<BeaconViewDialog />', () => {
|
|||
|
||||
expect(onFinished).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
describe('sidebar', () => {
|
||||
it('opens sidebar on view list button click', () => {
|
||||
const room = setupRoom([defaultEvent]);
|
||||
const beacon = room.currentState.beacons.get(getBeaconInfoIdentifier(defaultEvent));
|
||||
beacon.addLocations([location1]);
|
||||
const component = getComponent();
|
||||
|
||||
act(() => {
|
||||
findByTestId(component, 'beacon-view-dialog-open-sidebar').at(0).simulate('click');
|
||||
component.setProps({});
|
||||
});
|
||||
|
||||
expect(component.find('DialogSidebar').length).toBeTruthy();
|
||||
});
|
||||
|
||||
it('closes sidebar on close button click', () => {
|
||||
const room = setupRoom([defaultEvent]);
|
||||
const beacon = room.currentState.beacons.get(getBeaconInfoIdentifier(defaultEvent));
|
||||
beacon.addLocations([location1]);
|
||||
const component = getComponent();
|
||||
|
||||
// open the sidebar
|
||||
act(() => {
|
||||
findByTestId(component, 'beacon-view-dialog-open-sidebar').at(0).simulate('click');
|
||||
component.setProps({});
|
||||
});
|
||||
|
||||
expect(component.find('DialogSidebar').length).toBeTruthy();
|
||||
|
||||
// now close it
|
||||
act(() => {
|
||||
findByTestId(component, 'dialog-sidebar-close').at(0).simulate('click');
|
||||
component.setProps({});
|
||||
});
|
||||
|
||||
expect(component.find('DialogSidebar').length).toBeFalsy();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue