Skip to content

Commit

Permalink
Move the deleted test to 'custom function' suite.
Browse files Browse the repository at this point in the history
  • Loading branch information
elle-j committed Sep 20, 2023
1 parent 546bd03 commit 2287d88
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions integration-tests/tests/src/tests/sync/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -576,6 +576,18 @@ describe.skipIf(environment.missingServer, "User", () => {
await this.app.emailPasswordAuth.retryCustomConfirmation({ email: pendingEmail });
});

it("custom confirmation function rejects invalid email", async function (this: AppContext & RealmContext) {
const invalidEmail = randomNonVerifiableEmail();
const validPassword = "password123456";

const credentials = Realm.Credentials.emailPassword({ email: invalidEmail, password: validPassword });
await expect(this.app.logIn(credentials)).to.be.rejectedWith("invalid username/password"); // this user does not exist yet
expect(
this.app.emailPasswordAuth.registerUser({ email: invalidEmail, password: validPassword }),
).to.eventually.be.rejectedWith(`failed to confirm user "${invalidEmail}"`);
await expect(this.app.logIn(credentials)).to.be.rejectedWith("invalid username/password"); // this user did not register
});

it("reset password function works", async function (this: AppContext & RealmContext) {
const validEmail = randomVerifiableEmail();
const validPassword = "password123456";
Expand Down

0 comments on commit 2287d88

Please sign in to comment.