Push to prod (#201)

* CEC-2056 safari map (#186)

* CEC-2056 Fix Safari map popup

* Snapshot serializer for Private styles

* Combine serializers

* CEC-2207  Add is-online filter for vehicles list (#187)

* Add OptionsDropdown component

* Add is-online filter

* CEC-2237 Track sign in and keys (#188)

* Update stage (#189)

* CEC-2056 safari map (#186)

* CEC-2056 Fix Safari map popup

* Snapshot serializer for Private styles

* Combine serializers

* CEC-2207  Add is-online filter for vehicles list (#187)

* Add OptionsDropdown component

* Add is-online filter

* CEC-2237 Track sign in and keys (#188)

Co-authored-by: arpanetus <arpanetus@protonmail.com>

* CEC-2281 Update certificate form (#190)

* CEC-2281 Fix cert name

* CEC-2360 Fix filename display and add manifest type (#191)

* CEC-2360 Fix filename display and add manifest type

* const

* Push to Stage (#200)

* CEC-2144, CEC-2338  Add deploy by fleets and fix fleets table  (#192)

* Add fix for fleets search

* Decompose fleets table

* Add deploy by fleets

* Add snapshots

* CEC-2385 Only show software updates (#193)

* CEC-2385 Only show software updates

* Update browser list

* update threshold

* Clean up

* CEC-2291 Remote Commands (#194)

* CEC-2378 Add fix for fleet vehicles' search

* CEC-1235 Fix fleet name update (#196)

Co-authored-by: arpanetus <arpanetus@protonmail.com>

Co-authored-by: arpanetus <arpanetus@protonmail.com>
This commit is contained in:
John Wu
2022-09-19 15:55:55 -07:00
committed by GitHub
parent d995361b9f
commit 56043dc375
70 changed files with 3059 additions and 3416 deletions

View File

@@ -317,6 +317,55 @@ describe("VehicleContext", () => {
checkBaseResults("", "false");
});
});
describe("sendCommand", () => {
beforeEach(async () => {
const TestComp = () => {
const {busy, sendCommand} = useVehicleContext();
const { message, setMessage } = useStatusContext();
const sendC = async (vin, command) => {
try {
await sendCommand(vin, command);
} catch (e) {
setMessage(e.message);
}
};
return (
<>
<div data-testid="error">{message}</div>
<div data-testid="busy">{busy.toString()}</div>
<button data-testid="sendCommandNullVin" onClick={() => sendC(null, {command:"doors_lock"})} />
<button data-testid="sendCommandNonexistentVin" onClick={() => sendC(["11111111111111111"], {command:"doors_lock"})} />
<button
data-testid="sendCommandVin"
onClick={() => sendC("3C4PDCBG0ET127145", {command:"doors_lock"})}
/>
<button
data-testid="sendCommandWrongCommand"
onClick={() => sendC("3C4PDCBG0ET127145", {command:"noSuchCommand"})}
/>
</>
);}
render(
<StatusProvider>
<VehicleProvider>
<TestComp />
</VehicleProvider>
</StatusProvider>
);
});
afterEach(() => {
cleanup();
});
it("initial state", () => {
checkBaseResults("", "false");
});
})
});
const expectedFilters = [