mirror of
https://github.com/jkingsman/Remote-Terminal-for-MeshCore.git
synced 2026-08-08 01:33:01 +02:00
Add on-receive packet analyzer for canonical copy. Closes #97.
This commit is contained in:
@@ -557,6 +557,10 @@ describe('SettingsModal', () => {
|
||||
renderModal();
|
||||
openDatabaseSection();
|
||||
|
||||
expect(
|
||||
screen.getByText(/remove packet-analysis availability for those historical messages/i)
|
||||
).toBeInTheDocument();
|
||||
|
||||
fireEvent.click(screen.getByRole('button', { name: 'Purge Archival Raw Packets' }));
|
||||
|
||||
await waitFor(() => {
|
||||
|
||||
@@ -136,7 +136,7 @@ describe('useWebSocket dispatch', () => {
|
||||
expect(onContactResolved).toHaveBeenCalledWith('abc123def456', contact);
|
||||
});
|
||||
|
||||
it('routes message_acked to onMessageAcked with (messageId, ackCount, paths)', () => {
|
||||
it('routes message_acked to onMessageAcked with (messageId, ackCount, paths, packetId)', () => {
|
||||
const onMessageAcked = vi.fn();
|
||||
renderHook(() => useWebSocket({ onMessageAcked }));
|
||||
|
||||
@@ -144,7 +144,7 @@ describe('useWebSocket dispatch', () => {
|
||||
fireMessage({ type, data });
|
||||
|
||||
expect(onMessageAcked).toHaveBeenCalledOnce();
|
||||
expect(onMessageAcked).toHaveBeenCalledWith(42, 1, undefined);
|
||||
expect(onMessageAcked).toHaveBeenCalledWith(42, 1, undefined, undefined);
|
||||
});
|
||||
|
||||
it('routes message_acked with paths', () => {
|
||||
@@ -154,7 +154,16 @@ describe('useWebSocket dispatch', () => {
|
||||
const paths = [{ path: 'aabb', received_at: 1700000000 }];
|
||||
fireMessage({ type: 'message_acked', data: { message_id: 7, ack_count: 2, paths } });
|
||||
|
||||
expect(onMessageAcked).toHaveBeenCalledWith(7, 2, paths);
|
||||
expect(onMessageAcked).toHaveBeenCalledWith(7, 2, paths, undefined);
|
||||
});
|
||||
|
||||
it('routes message_acked with packet_id', () => {
|
||||
const onMessageAcked = vi.fn();
|
||||
renderHook(() => useWebSocket({ onMessageAcked }));
|
||||
|
||||
fireMessage({ type: 'message_acked', data: { message_id: 7, ack_count: 2, packet_id: 99 } });
|
||||
|
||||
expect(onMessageAcked).toHaveBeenCalledWith(7, 2, undefined, 99);
|
||||
});
|
||||
|
||||
it('routes error event to onError', () => {
|
||||
|
||||
Reference in New Issue
Block a user