Filter settings exported when rageshaking (#30236)
* Submit filtered settings to rageshakes and sentry. * Add flag to omit some settings from being exported. * Hide user timezone * Hide recent searches and media event ids * Lint * use better wording * lint * Prevent language from being sent * Add tests to check keys are prevented from being uploaded. * don't export invite rules * Update tests
This commit is contained in:
@@ -16,6 +16,7 @@ import BugReportDialog, {
|
||||
} from "../../../../../src/components/views/dialogs/BugReportDialog";
|
||||
import SdkConfig from "../../../../../src/SdkConfig";
|
||||
import { type ConsoleLogger } from "../../../../../src/rageshake/rageshake";
|
||||
import SettingsStore from "../../../../../src/settings/SettingsStore";
|
||||
|
||||
const BUG_REPORT_URL = "https://example.org/submit";
|
||||
|
||||
@@ -32,6 +33,16 @@ describe("BugReportDialog", () => {
|
||||
bug_report_endpoint_url: BUG_REPORT_URL,
|
||||
});
|
||||
|
||||
const originalGetValue = SettingsStore.getValue;
|
||||
jest.spyOn(SettingsStore, "getValue").mockImplementation((settingName, ...args) => {
|
||||
// These settings rely on a controller that creates an AudioContext in
|
||||
// order to test whether the setting can be enabled. For the sake of this test, disable that.
|
||||
if (settingName === "notificationsEnabled" || settingName === "notificationBodyEnabled") {
|
||||
return true;
|
||||
}
|
||||
return originalGetValue(settingName, ...args);
|
||||
});
|
||||
|
||||
const mockConsoleLogger = {
|
||||
flush: jest.fn(),
|
||||
consume: jest.fn(),
|
||||
@@ -55,6 +66,7 @@ describe("BugReportDialog", () => {
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
jest.restoreAllMocks();
|
||||
SdkConfig.reset();
|
||||
fetchMock.restore();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user