Skip to content

Conversation

@yedidya03
Copy link
Collaborator

No description provided.

};
}

function generateRandom(complexity: number = 4) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not use a library to generate UIDs?

(await request.get()) as FirebaseFirestore.QuerySnapshot<DbAppointment>;

const ret = toDbAppointments(appointments);
if (ret.length > 1) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See previous comment.

throw Error("there is more then one appointment with this share link!");
}

if (ret.length == 0) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See previous comment.

request: FunctionsApi.GetSharedLinkAppointmentRequest,
callerId: string
): Promise<FunctionsApi.GetSharedLinkAppointmentResponse> {
if (callerId !== request.donorId) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this API be called by an unregistered user?


const appointment = (await callTarget()).appointment;

expect(appointment).not.toBeNaN();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean to test "not to be undefined"?

).rejects.toThrow(Error);
});

test("Returns available appointments is ascending start time order", async () => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I understand the test title.

return appointment;
}

test("Not authenticated", async () => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As per previous, this should not stop users from accessing the API.

await setAppointment(appointment);
return appointment;
}

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about the logic test cases,
as written in getAppointmentByShareLink?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants