2025-05-14 21:45:16 +02:00

75 lines
2.1 KiB
TypeScript

/* eslint-disable @typescript-eslint/explicit-function-return-type */
import { clog } from '../../../lib/seed/helpers/Utils';
import { thunder } from '../../../__tests/app/config';
export class AccountEngineTest {
/* LOGIN */
logInMagicLink = async (input: { email?: string }) => {
const { email } = input;
const logInMagicLink = await thunder.query({
logInMagicLink: [
{
input: { email: email || 'software@makeit-studio.com' },
},
{
message: true,
},
],
});
return logInMagicLink;
};
logInEmailCodeRequest = async (input: { email?: string }) => {
const { email } = input;
const logInEmailCodeRequest = await thunder.query({
logInEmailCodeRequest: [
{
input: { email: email || 'software@makeit-studio.com' },
},
{
message: true,
},
],
});
return logInEmailCodeRequest;
};
logInEmailCodeConfirm = async (input: { email?: string; code?: number }) => {
const { email, code } = input;
const logInEmailCodeConfirm = await thunder.mutation({
logInEmailCodeConfirm: [
{
input: { email: email || 'software@makeit-studio.com', code: code || 0 },
},
{
idToken: true,
},
],
});
return logInEmailCodeConfirm;
};
/* SIGNIN */
signInEmailCodeRequest = async (input: { email?: string }) => {
const { email } = input;
const signInEmailCodeRequest = await thunder.mutation({
signInEmailCodeRequest: [
{
input: { email: email || 'software@makeit-studio.com' },
},
{
message: true,
},
],
} as any);
return signInEmailCodeRequest;
};
}