Skip to content

Commit

Permalink
TCHAP: specific tchap lint, removing src folder
Browse files Browse the repository at this point in the history
  • Loading branch information
marc.sirisak committed Nov 21, 2024
1 parent ce40d02 commit 35a3d54
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tchap_static_analysis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
run: "yarn install --frozen-lockfile"

- name: Run Linter
run: "yarn run lint:js"
run: "yarn run lint:js:tchap"

style_lint:
name: "Style Lint"
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
"start:res": "ts-node scripts/copy-res.ts -w",
"start:js": "webpack serve --output-path webapp --output-filename=bundles/_dev_/[name].js --output-chunk-filename=bundles/_dev_/[name].js --mode development",
"lint": "yarn lint:types && yarn lint:js && yarn lint:style && yarn lint:workflows",
"lint:js:tchap": "eslint --max-warnings 0 test module_system && prettier --check .",
"lint:js": "eslint --max-warnings 0 src test playwright module_system && prettier --check .",
"lint:js-fix": "prettier --log-level=warn --write . && eslint --fix src test playwright module_system",
"lint:types": "yarn lint:types:src && yarn lint:types:module_system",
Expand Down
17 changes: 4 additions & 13 deletions test/unit-tests/tchap/lib/createTchapRoom-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import TchapCreateRoom from "../../../../src/tchap/lib/createTchapRoom";
describe("Create room options", () => {
beforeEach(() => {});

it("builds option for private room", (done) => {
it("builds option for private room", () => {
const privateRoomExpectedOpts = {
createOpts: {
name: "testName",
Expand All @@ -33,10 +33,9 @@ describe("Create room options", () => {
expect(TchapCreateRoom.roomCreateOptions("testName", TchapRoomType.Private)).toStrictEqual(
privateRoomExpectedOpts,
);
done();
});

it("builds option for public room without federation", (done) => {
it("builds option for public room without federation", () => {
const publicRoomWithoutFederationExpectedOpts = {
createOpts: {
name: "testName",
Expand All @@ -63,10 +62,9 @@ describe("Create room options", () => {
expect(TchapCreateRoom.roomCreateOptions("testName", TchapRoomType.Forum, false)).toStrictEqual(
publicRoomWithoutFederationExpectedOpts,
);
done();
});

it("builds option for public room with federation", (done) => {
it("builds option for public room with federation", () => {
const publicRoomWithFederationExpectedOpts = {
createOpts: {
name: "testName",
Expand All @@ -93,10 +91,9 @@ describe("Create room options", () => {
expect(TchapCreateRoom.roomCreateOptions("testName", TchapRoomType.Forum, true)).toStrictEqual(
publicRoomWithFederationExpectedOpts,
);
done();
});

it("builds option for external room", (done) => {
it("builds option for external room", () => {
const externalRoomExpectedOpts = {
createOpts: {
name: "testName",
Expand All @@ -123,11 +120,5 @@ describe("Create room options", () => {
expect(TchapCreateRoom.roomCreateOptions("testName", TchapRoomType.External)).toStrictEqual(
externalRoomExpectedOpts,
);
done();
});

it("handles wrong inputs", (done) => {
//todo
done();
});
});
2 changes: 1 addition & 1 deletion test/unit-tests/tchap/rageshake/submit-rageshake-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ describe("Rageshakes", () => {
expect(appName).toBe("tchap-web");
});

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

Expand Down
3 changes: 1 addition & 2 deletions test/unit-tests/tchap/util/TchapRoomUtils-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import TchapRoomUtils from "~tchap-web/src/tchap/util/TchapRoomUtils";
describe("Provides utils method to get room type and state", () => {
beforeEach(() => {});

it("returns room type depending on encryption and access rule", (done) => {
it("returns room type depending on encryption and access rule", () => {
expect(TchapRoomUtils.getTchapRoomTypeInternal(true, TchapRoomAccessRule.Restricted)).toStrictEqual(
TchapRoomType.Private,
);
Expand All @@ -13,6 +13,5 @@ describe("Provides utils method to get room type and state", () => {
);
expect(TchapRoomUtils.getTchapRoomTypeInternal(true, "any")).toStrictEqual(TchapRoomType.Unknown);
expect(TchapRoomUtils.getTchapRoomTypeInternal(true, undefined)).toStrictEqual(TchapRoomType.Unknown);
done();
});
});

0 comments on commit 35a3d54

Please sign in to comment.