feat(web): pulido mobile de ficha de grupo, alumno, nuevo grupo y ajustes
- Ficha de grupo: "Agregar miembro" a todo el ancho y debajo Estadísticas,
Cobrar y Compartir con icono y texto (antes iconos sueltos en mobile).
Los mensajes automáticos de WhatsApp quedan en una fila plegable que
arranca cerrada si no hay ninguno activo.
- Historial del alumno: arranca en la primera clase registrada si es
anterior al alta, como la lista y la regla de riesgo ("1 de 5" en ambos).
- Nuevo grupo: cupo 10 por defecto, precio vacío obligatorio y foco
inicial en el nombre.
- Ajustes: chevron en Seguridad; el botón de tema del header queda solo
en desktop (en mobile vive en Apariencia).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -16,6 +16,7 @@ const db = {
|
||||
},
|
||||
attendance: {
|
||||
findMany: mock(),
|
||||
findFirst: mock(),
|
||||
},
|
||||
slotRelease: {
|
||||
count: mock(),
|
||||
@@ -251,6 +252,29 @@ describe('analytics routes', () => {
|
||||
});
|
||||
});
|
||||
|
||||
it('arranca en la primera clase registrada si es anterior al alta', async () => {
|
||||
// Loaded on 1/10 with classes already marked since 20/9: the history
|
||||
// starts at the first one, as the risk rule and the group list count it.
|
||||
prisma.group.findUnique.mockResolvedValue(makeGroup());
|
||||
prisma.attendee.findFirst.mockResolvedValue({
|
||||
id: 'a-1',
|
||||
fullName: 'Ana Pérez',
|
||||
createdAt: new Date('2026-10-01T00:00:00.000Z'),
|
||||
});
|
||||
prisma.attendance.findFirst.mockResolvedValueOnce({
|
||||
classSession: { startsAt: new Date('2026-09-20T10:00:00.000Z') },
|
||||
});
|
||||
prisma.classSession.findMany.mockResolvedValue([]);
|
||||
|
||||
await makeApp({ id: userId }).request('/groups/group-1/attendees/a-1/history');
|
||||
|
||||
expect(prisma.classSession.findMany).toHaveBeenCalledWith(
|
||||
expect.objectContaining({
|
||||
where: { groupId: 'group-1', startsAt: { gte: new Date('2026-09-20T10:00:00.000Z') } },
|
||||
}),
|
||||
);
|
||||
});
|
||||
|
||||
it('devuelve 404 si el alumno no pertenece al grupo', async () => {
|
||||
prisma.group.findUnique.mockResolvedValue(makeGroup());
|
||||
prisma.attendee.findFirst.mockResolvedValue(null);
|
||||
|
||||
Reference in New Issue
Block a user