Skip to content

Commit

Permalink
Merge pull request #982 from tchapgouv/920-readd-customApp-rageshake
Browse files Browse the repository at this point in the history
fix(rageshake): reallow customapp field
  • Loading branch information
MarcWadai authored Apr 29, 2024
2 parents ae77987 + 3bb3984 commit 11bcb32
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ async function collectBaseInformation(body: FormData, opts: IOpts): Promise<void
/* :TCHAP: bug-reporting - rename app - for bugreport rageshakes
body.append("app", opts.customApp || "element-web");
*/
body.append("app", "tchap-web");
body.append("app", opts.customApp || "tchap-web");
// end :TCHAP:
body.append("version", version ?? "UNKNOWN");
body.append("user_agent", userAgent);
Expand Down
9 changes: 8 additions & 1 deletion test/unit-tests/tchap/rageshake/submit-rageshake-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,20 @@ describe("Rageshakes", () => {
windowSpy.mockRestore();
});

it("should include app name", async () => {
it("should include app name default as tchap", async () => {
const formData = await collectBugReport();
const appName = formData.get("app");

expect(appName).toBe("tchap-web");
});

it("should include custom app name ", async () => {
const formData = await collectBugReport({ customApp: "toto" });
const appName = formData.get("app");

expect(appName).toBe("toto");
});

// We did not customise the custom fields code, but we test to guard against changes of output if element changes
// custom field code.
it("should collect Tchap custom fields", async () => {
Expand Down

0 comments on commit 11bcb32

Please sign in to comment.