Skip to content

fix: fix duplicated agent logs #17806

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
May 15, 2025
Prev Previous commit
Next Next commit
Mock websocket on storybook to support OneWayWebsocket
  • Loading branch information
BrunoQuaresma committed May 14, 2025
commit a7e13a0362fe3853f4a342d955f5dec680ff9ada
4 changes: 4 additions & 0 deletions site/src/testHelpers/storybook.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ export const withWebSocket = (Story: FC, { parameters }: StoryContext) => {
let callEventsDelay: number;

window.WebSocket = class WebSocket {
public readyState = 1;

addEventListener(type: string, callback: CallbackFn) {
listeners.set(type, callback);

Expand All @@ -93,6 +95,8 @@ export const withWebSocket = (Story: FC, { parameters }: StoryContext) => {
}, 0);
}

removeEventListener(type: string, callback: CallbackFn) {}

close() {}
} as unknown as typeof window.WebSocket;

Expand Down
Loading