Skip to content

Commit

Permalink
remove irrelevant accessible controller connection warning (#4485)
Browse files Browse the repository at this point in the history
  • Loading branch information
kshen0 authored Jan 8, 2024
1 parent 48c7fac commit b0e182d
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 52 deletions.
3 changes: 1 addition & 2 deletions apps/mark-scan/frontend/src/app_root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ export function AppRoot({
const machineConfigQuery = getMachineConfig.useQuery();

const devices = useDevices({ hardware, logger });
const { accessibleController, computer } = devices;
const { computer } = devices;

const usbDriveStatusQuery = getUsbDriveStatus.useQuery();
const authStatusQuery = getAuthStatus.useQuery();
Expand Down Expand Up @@ -551,7 +551,6 @@ export function AppRoot({
<InsertCardScreen
appPrecinct={precinctSelection}
electionDefinition={optionalElectionDefinition}
showNoAccessibleControllerWarning={!accessibleController}
showNoChargerAttachedWarning={!computer.batteryIsCharging}
isLiveMode={!isTestMode}
pollsState={pollsState}
Expand Down
42 changes: 0 additions & 42 deletions apps/mark-scan/frontend/src/app_setup_errors.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,48 +37,6 @@ const lowBatteryErrorScreenText = 'No Power Detected and Battery is Low';
const noPowerDetectedWarningText = 'No Power Detected.';

describe('Displays setup warning messages and errors screens', () => {
it('Displays warning if Accessible Controller connection is lost', async () => {
apiMock.expectGetMachineConfig();
const hardware = MemoryHardware.buildStandard();
hardware.setAccessibleControllerConnected(true);

apiMock.expectGetElectionDefinition(electionGeneralDefinition);
apiMock.expectGetElectionState({
precinctSelection: ALL_PRECINCTS_SELECTION,
pollsState: 'polls_open',
});

render(
<App
hardware={hardware}
apiClient={apiMock.mockApiClient}
reload={jest.fn()}
/>
);
const accessibleControllerWarningText =
'Voting with an accessible controller is not currently available.';

// Start on Insert Card screen
await screen.findByText(insertCardScreenText);
expect(screen.queryByText(accessibleControllerWarningText)).toBeFalsy();

// Disconnect Accessible Controller
act(() => {
hardware.setAccessibleControllerConnected(false);
});
await advanceTimersAndPromises();
screen.getByText(accessibleControllerWarningText);
screen.getByText(insertCardScreenText);

// Reconnect Accessible Controller
act(() => {
hardware.setAccessibleControllerConnected(true);
});
await advanceTimersAndPromises();
expect(screen.queryByText(accessibleControllerWarningText)).toBeFalsy();
screen.getByText(insertCardScreenText);
});

it('Displays error screen if Card Reader connection is lost', async () => {
apiMock.expectGetMachineConfig();
const hardware = MemoryHardware.buildStandard();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ test('renders correctly', async () => {
showNoChargerAttachedWarning={false}
isLiveMode={false}
pollsState="polls_closed_initial"
showNoAccessibleControllerWarning={false}
/>
</QueryClientProvider>
</ApiClientContext.Provider>
Expand Down
7 changes: 0 additions & 7 deletions apps/mark-scan/frontend/src/pages/insert_card_screen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ interface Props {
showNoChargerAttachedWarning: boolean;
isLiveMode: boolean;
pollsState: PollsState;
showNoAccessibleControllerWarning: boolean;
}

export function InsertCardScreen({
Expand All @@ -36,7 +35,6 @@ export function InsertCardScreen({
showNoChargerAttachedWarning,
isLiveMode,
pollsState,
showNoAccessibleControllerWarning,
}: Props): JSX.Element | null {
useEffect(triggerAudioFocus, []);

Expand Down Expand Up @@ -87,11 +85,6 @@ export function InsertCardScreen({
<InsertCardImage />
</P>
{mainText}
{showNoAccessibleControllerWarning && (
<Caption>
Voting with an accessible controller is not currently available.
</Caption>
)}
</Prose>
</Main>
<ElectionInfoBar
Expand Down

0 comments on commit b0e182d

Please sign in to comment.