Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Devolver solo actividades futuras por defecto #107

Closed
faloi opened this issue Feb 25, 2021 · 0 comments · Fixed by unahur-turnos/backend#45
Closed

Devolver solo actividades futuras por defecto #107

faloi opened this issue Feb 25, 2021 · 0 comments · Fixed by unahur-turnos/backend#45
Assignees
Labels

Comments

@faloi
Copy link
Contributor

faloi commented Feb 25, 2021

✔️ Objetivos

Reducir la cantidad de actividades que se envían al cliente.

🧑‍💻 Notas para el desarrollo

Modificar el método conTurnos para que, por defecto, tenga un desde con el día de hoy. Con eso debería ser suficiente para que en el front no se muestren actividades que ya pasaron en ninguna vista. Si mal no recuerdo ya funciona así, pero verificar que devuelva todas las del día (sin importar la hora).

Para testear esto, habría que mockear la fecha actual - porque si no se haría un test dependiente del día en que se corre. Esto se logra así:

describe('Test', () => {
  // to avoid race conditions between expected and actual date values
  beforeAll(() => {
    jest.useFakeTimers('modern');
    jest.setSystemTime(new Date(2020, 01, 01)); // Obviamente acá puede ir cualquier fecha.
  });

  afterAll(() => {
    // Back to reality...
    jest.useRealTimers();
  });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants