-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1d3e105
commit 2adec30
Showing
16 changed files
with
119 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,22 +5,29 @@ import { | |
updateUser, | ||
type SynapseInstance, | ||
} from '../docker/synapse'; | ||
import { | ||
startServer as startRealmServer, | ||
type IsolatedRealmServer, | ||
} from '../helpers/isolated-realm-server'; | ||
import { smtpStart, smtpStop } from '../docker/smtp4dev'; | ||
import { | ||
openRoot, | ||
clearLocalStorage, | ||
gotoRegistration, | ||
assertLoggedIn, | ||
registerRealmUsers, | ||
setupUserSubscribed, | ||
} from '../helpers'; | ||
import { registerUser, createRegistrationToken } from '../docker/synapse'; | ||
|
||
const REGISTRATION_TOKEN = 'abc123'; | ||
|
||
test.describe('Login using email', () => { | ||
let synapse: SynapseInstance; | ||
let realmServer: IsolatedRealmServer; | ||
|
||
test.beforeEach(async ({ page }) => { | ||
test.setTimeout(120_000); | ||
synapse = await synapseStart({ | ||
template: 'test', | ||
}); | ||
|
@@ -29,18 +36,21 @@ test.describe('Login using email', () => { | |
let admin = await registerUser(synapse, 'admin', 'adminpass', true); | ||
await createRegistrationToken(admin.accessToken, REGISTRATION_TOKEN); | ||
await registerRealmUsers(synapse); | ||
realmServer = await startRealmServer(); | ||
await clearLocalStorage(page); | ||
await gotoRegistration(page); | ||
await registerUser(synapse, 'user1', 'mypassword1!'); | ||
await updateUser(admin.accessToken, '@user1:localhost', { | ||
emailAddresses: ['[email protected]'], | ||
displayname: 'Test User', | ||
}); | ||
await setupUserSubscribed('@user1:localhost', realmServer); | ||
}); | ||
|
||
test.afterEach(async () => { | ||
await synapseStop(synapse.synapseId); | ||
await smtpStop(); | ||
await realmServer.stop(); | ||
}); | ||
|
||
test('Login using email', async ({ page }) => { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.