From 15e2fb98de35c06166c2f9b9e5bb6f76595e3f09 Mon Sep 17 00:00:00 2001 From: Estelle Comment Date: Thu, 11 Apr 2024 14:30:03 +0200 Subject: [PATCH] Test drafts --- .../components/views/dialogs/ExpiredAccountDialog.tsx | 2 +- .../views/dialogs/ExpiredAccountDialog-test.tsx | 5 +++++ test/unit-tests/tchap/lib/ExpiredAccountHandler-test.ts | 9 +++++++++ 3 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 test/unit-tests/tchap/components/views/dialogs/ExpiredAccountDialog-test.tsx create mode 100644 test/unit-tests/tchap/lib/ExpiredAccountHandler-test.ts diff --git a/src/tchap/components/views/dialogs/ExpiredAccountDialog.tsx b/src/tchap/components/views/dialogs/ExpiredAccountDialog.tsx index 53dccd7fa8..a712570929 100644 --- a/src/tchap/components/views/dialogs/ExpiredAccountDialog.tsx +++ b/src/tchap/components/views/dialogs/ExpiredAccountDialog.tsx @@ -101,7 +101,7 @@ export default class ExpiredAccountDialog extends React.Component // todo translation+format or spinner + alertMessage = break; case ProcessState.EMAIL_MUST_WAIT: //don't know which class should decorate this message, it is not really an error diff --git a/test/unit-tests/tchap/components/views/dialogs/ExpiredAccountDialog-test.tsx b/test/unit-tests/tchap/components/views/dialogs/ExpiredAccountDialog-test.tsx new file mode 100644 index 0000000000..3bdec63389 --- /dev/null +++ b/test/unit-tests/tchap/components/views/dialogs/ExpiredAccountDialog-test.tsx @@ -0,0 +1,5 @@ +describe("ExpiredAccountDialog", () => { + it("sends email when 'Send email' button is clicked", () => {}); + it("when 'I renewed' is clicked, and the account is renewed, it displays 'cool' and unblocks user (todo)", () => {}); + it("when 'I renewed' is clicked, and the account is not renewed, it displays 'not cool' and keeps dialog up (todo)", () => {}); +}); diff --git a/test/unit-tests/tchap/lib/ExpiredAccountHandler-test.ts b/test/unit-tests/tchap/lib/ExpiredAccountHandler-test.ts new file mode 100644 index 0000000000..4d18fa82f9 --- /dev/null +++ b/test/unit-tests/tchap/lib/ExpiredAccountHandler-test.ts @@ -0,0 +1,9 @@ +describe("ExpiredAccountHandler", () => { + it("displays dialog when account is expired", () => { + // Modal.createDialog + // create handler + // dispatch action : will_start_client + // cli.on(HttpApiEvent.ORG_MATRIX_EXPIRED_ACCOUNT) + // expect Modal.createDialog to have been called, with ExpiredAccountDialog class + }); +});