Allow local log downloads when a rageshake URL is not configured. (#31716)
* Add support for storing debug logs locally and allowing local downloads. * static * Comprehensive testing for bug report flow. * Driveby cleanup of typography * fix i18n * Improvements to UX * More testing * update snaps * linting * lint * Fix feedback * Fix boldnewss * fix bold * fix heading * Increase test coverage * remove focus * Don't show the FAQ depending on whether you can submit feedback. * move reset * fix err * Remove unused * update snap * Remove text * Bumping up that coverage * tidy * lint * update snap * Use a const * fix imports * Remove import in e2e test * whoops
This commit is contained in:
@@ -49,6 +49,7 @@ import { type SettingKey } from "../../../src/settings/Settings.tsx";
|
||||
import SdkConfig from "../../../src/SdkConfig.ts";
|
||||
import DMRoomMap from "../../../src/utils/DMRoomMap.ts";
|
||||
import { WidgetMessagingEvent, type WidgetMessaging } from "../../../src/stores/widgets/WidgetMessaging.ts";
|
||||
import { BugReportEndpointURLLocal } from "../../../src/IConfigOptions.ts";
|
||||
|
||||
const { enabledSettings } = enableCalls();
|
||||
|
||||
@@ -494,12 +495,12 @@ describe("ElementCall", () => {
|
||||
beforeEach(() => {
|
||||
jest.useFakeTimers();
|
||||
({ client, room, alice, roomSession } = setUpClientRoomAndStores());
|
||||
SdkConfig.reset();
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
jest.runOnlyPendingTimers();
|
||||
jest.useRealTimers();
|
||||
SdkConfig.reset();
|
||||
cleanUpClientRoomAndStores(client, room);
|
||||
});
|
||||
|
||||
@@ -699,6 +700,24 @@ describe("ElementCall", () => {
|
||||
SettingsStore.getValue = originalGetValue;
|
||||
});
|
||||
|
||||
it.each([
|
||||
[undefined, null],
|
||||
[BugReportEndpointURLLocal, null],
|
||||
["other-value", "other-value"],
|
||||
])("passes rageshake URL through widget URL", async (configSetting, expectedValue) => {
|
||||
// Test with the preference set to false
|
||||
SdkConfig.put({
|
||||
bug_report_endpoint_url: configSetting,
|
||||
});
|
||||
ElementCall.create(room);
|
||||
const call1 = Call.get(room);
|
||||
if (!(call1 instanceof ElementCall)) throw new Error("Failed to create call");
|
||||
|
||||
const urlParams1 = new URLSearchParams(new URL(call1.widget.url).hash.slice(1));
|
||||
expect(urlParams1.get("rageshakeSubmitUrl")).toBe(expectedValue);
|
||||
call1.destroy();
|
||||
});
|
||||
|
||||
it("passes analyticsID and posthog params through widget URL", async () => {
|
||||
SdkConfig.put({
|
||||
posthog: {
|
||||
|
||||
Reference in New Issue
Block a user