Upgrades prisma to latest version (#1894)
* Upgrades prisma * Extends Stripe paid booking timeout * Stripe test fixes * Disables cache for db-reset * Disabled cache from db-seed * Avatar fixes * Fixes paid booking test once and for all Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
This commit is contained in:
1 parent
81b4443fc2
commit
deeafb21a5
5 files changed
+34
-35
No files matched your search
@@ -8,6 +8,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
|
||||
// const username = req.url?.substring(1, req.url.lastIndexOf("/"));
|
||||
const username = req.query.username as string;
|
||||
const user = await prisma.user.findUnique({
|
||||
rejectOnNotFound: true,
|
||||
where: {
|
||||
username: username,
|
||||
},
|
||||
@@ -19,9 +20,9 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
|
||||
|
||||
const emailMd5 = crypto
|
||||
.createHash("md5")
|
||||
.update(user?.email as string)
|
||||
.update(user.email as string)
|
||||
.digest("hex");
|
||||
const img = user?.avatar;
|
||||
const img = user.avatar;
|
||||
if (!img) {
|
||||
res.writeHead(302, {
|
||||
Location: defaultAvatarSrc({ md5: emailMd5 }),
|
||||
|
||||
@@ -49,23 +49,18 @@ test.describe.serial("Stripe integration", () => {
|
||||
|
||||
await Promise.all([page.waitForNavigation({ url: "/payment/*" }), page.press('[name="email"]', "Enter")]);
|
||||
|
||||
await page.waitForSelector('iframe[src^="https://js.stripe.com/v3/elements-inner-card-"]');
|
||||
|
||||
// We lookup Stripe's iframe
|
||||
const stripeFrame = page.frame({
|
||||
url: (url) => url.href.startsWith("https://js.stripe.com/v3/elements-inner-card-"),
|
||||
});
|
||||
|
||||
if (!stripeFrame) throw new Error("Stripe frame not found");
|
||||
const stripeFrame = page
|
||||
.frameLocator('iframe[src^="https://js.stripe.com/v3/elements-inner-card-"]')
|
||||
.first();
|
||||
|
||||
// Fill [placeholder="Card number"]
|
||||
await stripeFrame.fill('[placeholder="Card number"]', "4242 4242 4242 4242");
|
||||
await stripeFrame.locator('[placeholder="Card number"]').fill("4242 4242 4242 4242");
|
||||
// Fill [placeholder="MM / YY"]
|
||||
await stripeFrame.fill('[placeholder="MM / YY"]', "12 / 24");
|
||||
await stripeFrame.locator('[placeholder="MM / YY"]').fill("12 / 24");
|
||||
// Fill [placeholder="CVC"]
|
||||
await stripeFrame.fill('[placeholder="CVC"]', "111");
|
||||
await stripeFrame.locator('[placeholder="CVC"]').fill("111");
|
||||
// Fill [placeholder="ZIP"]
|
||||
await stripeFrame.fill('[placeholder="ZIP"]', "111111");
|
||||
await stripeFrame.locator('[placeholder="ZIP"]').fill("11111");
|
||||
// Click button:has-text("Pay now")
|
||||
await page.click('button:has-text("Pay now")');
|
||||
|
||||
|
||||
Reference in new issue
Block a user