mirror of
https://github.com/CompassConnections/Compass.git
synced 2026-02-23 18:36:02 -05:00
* . * Centralizing config details * Added data-testId attributes where necessary and started the onboarding flow scaffolding * Continued onboarding test scaffolding * Continued work on tests for the Onboarding flow * . * Updated "Want kids" options to be less flaky Updated playwright.config so that expect timeout matching test timeout * Continued updating front-end scaffolding * . * . * . * . * Updated fixture function deleteUser: to also remove the database user information * Rm * Fix * Fixes --------- Co-authored-by: MartinBraquet <martin.braquet@gmail.com>
27 lines
912 B
TypeScript
27 lines
912 B
TypeScript
class DatabaseTestingUtilities {
|
|
findUserByName = async (page: any, name: string) => {
|
|
const queryUserById = `
|
|
SELECT p.*
|
|
FROM public.users AS p
|
|
WHERE name = $1
|
|
`;
|
|
const userResults = await page.db.query(queryUserById,[name])
|
|
return userResults[0]
|
|
};
|
|
|
|
findProfileById = async (page: any, user_id: string) => {
|
|
const queryProfileById = `
|
|
SELECT
|
|
p.*,
|
|
TO_CHAR(p.created_time, 'Mon DD, YYYY HH12:MI AM') as created_date,
|
|
TO_CHAR(p.last_modification_time, 'Mon DD, YYYY HH12:MI AM') as modified_date
|
|
FROM public.profiles AS p
|
|
WHERE user_id = $1
|
|
`;
|
|
const profileResults = await page.db.query(queryProfileById,[user_id])
|
|
return profileResults[0]
|
|
};
|
|
|
|
};
|
|
|
|
export const databaseUtils = new DatabaseTestingUtilities(); |