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:
Kerry 2022-04-20 10:14:24 +02:00 committed by GitHub
parent a471742e97
commit e45cd39906
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 307 additions and 3 deletions

View file

@ -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();
});
});
});