LLS: rename wireError (#8401)

* rename wireError in ownbeaconstore to locationPublishError

Signed-off-by: Kerry Archibald <kerrya@element.io>

* rename getLiveBeaconIdsWithWireError -> getLiveBeaconIdsWithLocationPublishError

Signed-off-by: Kerry Archibald <kerrya@element.io>

* rename wire error variables in components

Signed-off-by: Kerry Archibald <kerrya@element.io>

* new snapshots for new test names

Signed-off-by: Kerry Archibald <kerrya@element.io>

* fix bad capitalisation on onResetLocationPublishError

Signed-off-by: Kerry Archibald <kerrya@element.io>

* missed variable

Signed-off-by: Kerry Archibald <kerrya@element.io>
This commit is contained in:
Kerry
2022-04-25 12:44:18 +00:00
committed by GitHub
parent a3f9123f6c
commit 8c6786bad6
11 changed files with 133 additions and 120 deletions
@@ -94,12 +94,12 @@ describe('<OwnBeaconStatus />', () => {
expect(component.find('AccessibleButton').length).toBeFalsy();
});
describe('with wire error', () => {
describe('with location publish error', () => {
it('renders in error mode', () => {
const displayStatus = BeaconDisplayStatus.Active;
mocked(useOwnLiveBeacons).mockReturnValue({
hasWireError: true,
onResetWireError: jest.fn(),
hasLocationPublishError: true,
onResetLocationPublishError: jest.fn(),
});
const component = getComponent({ displayStatus, beacon: defaultBeacon });
expect(component.text()).toContain('Live location error');
@@ -107,19 +107,19 @@ describe('<OwnBeaconStatus />', () => {
expect(findByTestId(component, 'beacon-status-reset-wire-error').length).toBeTruthy();
});
it('retry button resets wire error', () => {
it('retry button resets location publish error', () => {
const displayStatus = BeaconDisplayStatus.Active;
const onResetWireError = jest.fn();
const onResetLocationPublishError = jest.fn();
mocked(useOwnLiveBeacons).mockReturnValue({
hasWireError: true,
onResetWireError,
hasLocationPublishError: true,
onResetLocationPublishError,
});
const component = getComponent({ displayStatus, beacon: defaultBeacon });
act(() => {
findByTestId(component, 'beacon-status-reset-wire-error').at(0).simulate('click');
});
expect(onResetWireError).toHaveBeenCalled();
expect(onResetLocationPublishError).toHaveBeenCalled();
});
});
@@ -127,7 +127,7 @@ describe('<OwnBeaconStatus />', () => {
it('renders in error mode', () => {
const displayStatus = BeaconDisplayStatus.Active;
mocked(useOwnLiveBeacons).mockReturnValue({
hasWireError: false,
hasLocationPublishError: false,
hasStopSharingError: true,
onStopSharing: jest.fn(),
});