Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: seed existing user for e2e tests #969

Merged
merged 6 commits into from
Aug 23, 2023

Conversation

irby
Copy link
Contributor

@irby irby commented Aug 14, 2023

Description

As mentioned in #955, I noticed the end-to-end tests do not have a way to test out flows for users that already exist. This is especially important for the end-to-end test when signup is disallowed. I wanted to be able to verify the flow for existing users.

This change will seed a user so we can verify the various flows for existing users in the end-to-end tests.

Implementation

Aside from migrations, there doesn't seem to be an existing solution to seed data into the databases. While I could've created a separate process within the hanko backend to handle seeding, since this behavior was not requested I decided to not add any functionality to the backend. Instead, I created a SQL script that will be executed by a seeder Docker container after the migrator container has added migrations. The script has constant values it will add into the database, including a user with the email [email protected] that will be used by the end-to-end tests.

Tests

Added tests within the nosignup, pw and nopw tests to verify the flow of existing users and what the next screen they see would be after they login.

Todos

N/A

Additional context

N/A

@irby irby changed the title Seed existing user for e2e tests feat: seed existing user for e2e tests Aug 14, 2023
@lfleischmann
Copy link
Member

Hi @irby,

sorry for the delay. LGTM, will merge now!

@lfleischmann lfleischmann merged commit a1564e5 into teamhanko:main Aug 23, 2023
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants