Skip to content

Commit

Permalink
add checkpoints to test
Browse files Browse the repository at this point in the history
  • Loading branch information
jho44 committed Feb 25, 2024
1 parent b0fcae8 commit b9be628
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 18 deletions.
15 changes: 10 additions & 5 deletions tests/profile.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,18 @@ const phone = '+12016660127';
test.beforeEach(async () => {
const prisma = new PrismaClient();
const utils = new SeedUtils(new Date(), prisma);
await utils.deleteUsers({ phone })
await utils.deleteUsers({ phone });
await prisma.$disconnect();
});

test.only('User can create new profile with valid phone number', async ({ page }) => {
await page.goto(host);

console.log('CHECKPOINT 1');
await page.waitForTimeout(3000);
await page.getByRole('textbox').fill(phone);
await page.getByRole('button').click();
console.log('CHECKPOINT 2');

let token: string;
const retrieveTokenFromServerLog = async (msg: ConsoleMessage) => {
Expand All @@ -37,19 +39,22 @@ test.only('User can create new profile with valid phone number', async ({ page }
}
}, 100);
});
console.log('CHECKPOINT 3');
await page.goto(`${host}/login/${token!}`);
await page.waitForURL(`${host}/profile`);

console.log('CHECKPOINT 4');
// if this shows up, then that means the modal is open, which means this is a brand new user, as expected
const acceptBtn = page.locator('dialog button');
await acceptBtn.waitFor();
await acceptBtn.click()
await acceptBtn.waitFor({ state: 'hidden'});

await acceptBtn.click();
await acceptBtn.waitFor({ state: 'hidden' });
console.log('CHECKPOINT 5');
await page.getByLabel('First Name').fill('FIRST_NAME');
await page.getByLabel('Last Name').fill('LAST_NAME');
await page.getByLabel('Pronouns').selectOption('SHE_HER_HERS');

console.log('CHECKPOINT 6');
await page.getByText('Save').click();
console.log('CHECKPOINT 7');
await page.waitForURL(`${host}/household`);
});
13 changes: 0 additions & 13 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,5 @@
{
"extends": "./.svelte-kit/tsconfig.json",
"include": [

// "ambient.d.ts",
// "./types/**/$types.d.ts",
// "../vite.config.js",
// "../vite.config.ts",
// "../src/**/*.js",
// "../src/**/*.ts",
// "../src/**/*.svelte",
// "../tests/**/*.js",
// "../tests/**/*.ts",
// "../tests/**/*.svelte"
],
"compilerOptions": {
"allowJs": true,
"checkJs": true,
Expand Down

0 comments on commit b9be628

Please sign in to comment.