mirror of
https://github.com/CompassConnections/Compass.git
synced 2026-05-29 19:31:19 -04:00
Added checks to the deleteUser func to check if the accout exists
Added account deletion checks
This commit is contained in:
@@ -251,6 +251,77 @@ test.describe('when given valid input', () => {
|
||||
await expect(dbInfo.user.username).toContain(fakerAccount.username)
|
||||
})
|
||||
|
||||
test('should successfully delete an account created via email and password', async ({
|
||||
homePage,
|
||||
onboardingPage,
|
||||
signUpPage,
|
||||
authPage,
|
||||
profilePage,
|
||||
settingsPage,
|
||||
fakerAccount,
|
||||
}) => {
|
||||
await registerWithEmail(homePage, authPage, fakerAccount)
|
||||
await skipOnboardingHeadToProfile(onboardingPage, signUpPage, profilePage, fakerAccount)
|
||||
|
||||
//Verify displayed information is correct
|
||||
await profilePage.verifyDisplayName(fakerAccount.display_name)
|
||||
|
||||
//Verify database info
|
||||
const dbInfo = await userInformationFromDb(fakerAccount)
|
||||
|
||||
await expect(dbInfo.user.name).toContain(fakerAccount.display_name)
|
||||
await expect(dbInfo.user.username).toContain(fakerAccount.username)
|
||||
|
||||
await homePage.clickSettingsLink()
|
||||
await settingsPage.clickDeleteAccountButton()
|
||||
await settingsPage.fillDeleteAccountSurvey("Delete me")
|
||||
await settingsPage.clickDeleteAccountButton()
|
||||
await homePage.verifyHomePageLinks()
|
||||
})
|
||||
|
||||
test('should successfully delete an account created via google auth', async ({
|
||||
homePage,
|
||||
onboardingPage,
|
||||
signUpPage,
|
||||
authPage,
|
||||
profilePage,
|
||||
settingsPage,
|
||||
googleAccountTwo,
|
||||
}) => {
|
||||
console.log(
|
||||
`Starting "should successfully delete an account created via google auth" with ${googleAccountTwo.username}`,
|
||||
)
|
||||
await homePage.gotToRegisterPage()
|
||||
await authPage.fillPasswordField('') //The test only passes when this is added...something is weird here
|
||||
await authPage.signInToGoogleAccount(
|
||||
googleAccountTwo.email,
|
||||
googleAccountTwo.display_name,
|
||||
googleAccountTwo.username,
|
||||
)
|
||||
await onboardingPage.clickSkipOnboardingButton()
|
||||
await signUpPage.fillDisplayName(googleAccountTwo.display_name)
|
||||
await signUpPage.fillUsername(googleAccountTwo.username)
|
||||
await signUpPage.clickNextButton()
|
||||
await signUpPage.clickNextButton() //Skip optional information
|
||||
await profilePage.clickCloseButton()
|
||||
await onboardingPage.clickRefineProfileButton()
|
||||
|
||||
//Verify displayed information is correct
|
||||
await profilePage.verifyDisplayName(googleAccountTwo.display_name)
|
||||
|
||||
//Verify database info
|
||||
const dbInfo = await userInformationFromDb(googleAccountTwo)
|
||||
|
||||
await expect(dbInfo.user.name).toContain(googleAccountTwo.display_name)
|
||||
await expect(dbInfo.user.username).toContain(googleAccountTwo.username)
|
||||
|
||||
await homePage.clickSettingsLink()
|
||||
await settingsPage.clickDeleteAccountButton()
|
||||
await settingsPage.fillDeleteAccountSurvey("Delete me")
|
||||
await settingsPage.clickDeleteAccountButton()
|
||||
await homePage.verifyHomePageLinks()
|
||||
})
|
||||
|
||||
test('should successfully enter optional information after completing flow', async ({
|
||||
app,
|
||||
fakerAccount,
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
import {test, expect} from '../fixtures/signInFixture'
|
||||
import * as fs from 'fs'
|
||||
|
||||
test.describe('when given valid input', () => {
|
||||
test('should be logged in and see settings page', async ({authenticatedPage, homePage}) => {
|
||||
await homePage.gotToHomePage()
|
||||
// await authenticatedPage.goto('/settings')
|
||||
|
||||
// await expect(authenticatedPage.getByRole('heading', { name: 'Theme' })).toBeVisible()
|
||||
})
|
||||
})
|
||||
|
||||
test.describe('when an error occurs', () => {
|
||||
test('placeholder', async () => {})
|
||||
})
|
||||
@@ -45,4 +45,12 @@ test.describe('when given invalid input', () => {
|
||||
page.getByText('Failed to sign in with your email and password', {exact: true}),
|
||||
).toBeVisible()
|
||||
})
|
||||
|
||||
test('login check', async ({}) => {
|
||||
|
||||
});
|
||||
})
|
||||
|
||||
test.describe('when an error occurs', () => {
|
||||
test('placeholder', async () => {})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user