Skip to content

[Backend] — Test: OracleService.getPendingMatches excludes future and already-submitted matches #1155

Description

@Olowodarey

Background

OracleService.getPendingMatches (src/oracle/oracle.service.ts) queries
matches where match_time < now AND result_submitted = false. There are no
tests verifying that:

  1. Matches with match_time > now (future) are excluded.
  2. Matches with result_submitted = true are excluded.
  3. Only the intersection (past AND unsubmitted) is returned.

Goal

Add tests in src/oracle/oracle.service.spec.ts (create if absent).

Requirements

  1. Seed four matches:
    • Past + unsubmitted → included.
    • Past + submitted → excluded.
    • Future + unsubmitted → excluded.
    • Future + submitted → excluded.
  2. Assert only the first match appears in the results.
  3. Assert total = 1 in the paginated response.

Acceptance criteria

  • Only past + unsubmitted matches returned.
  • time_since_match_started_seconds is non-negative and approximately correct.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions