Skip to content

Commit

Permalink
Remove impossible test
Browse files Browse the repository at this point in the history
  • Loading branch information
kneth committed Sep 20, 2023
1 parent 3e7b42e commit 546bd03
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions integration-tests/tests/src/tests/sync/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ describe.skipIf(environment.missingServer, "User", () => {
});

describe("autoverify email password works", () => {
// any email address is valid and registerUser() will never fail when auto-confirm is enabled. The combination invalid email
// valid password cannot be tested.
importAppBefore(buildAppConfig("with-email-password").emailPasswordAuth());
removeExistingUsers();

Expand All @@ -122,16 +124,6 @@ describe.skipIf(environment.missingServer, "User", () => {
await expect(this.app.logIn(credentials)).to.be.rejectedWith("invalid username/password"); // this user did not register
});

// any email address is valid and registerUser() will never fail -- the test doesn't make sense
it.skip("invalid email, valid password", async function (this: AppContext & RealmContext) {
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("valid email, invalid password", async function (this: AppContext & RealmContext) {
const credentials = Realm.Credentials.emailPassword({ email: validEmail, password: invalidPassword });
await expect(this.app.logIn(credentials)).to.be.rejectedWith("invalid username/password"); // this user does not exist yet
Expand Down

0 comments on commit 546bd03

Please sign in to comment.