Skip to content

Add unit tests for the page load performance log confirming all four fields are present and correctly typed #678

Description

@Chucks1093

Summary

The Navigation Timing API log emits four fields on each page load but has no unit tests verifying the field values are correctly extracted from the PerformanceNavigationTiming entry. Tests should confirm each field is a non-negative number and that the log is not emitted when timing data is unavailable.

Scope

  • Mock a PerformanceNavigationTiming entry with known values
  • Assert the emitted log contains dom_content_loaded_ms, load_event_ms, time_to_first_byte_ms, and route
  • Assert all timing fields are non-negative numbers
  • Mock the case where PerformanceNavigationTiming is unavailable and assert no log is emitted

Acceptance Criteria

  • All four fields present in the emitted log
  • All timing fields are non-negative numbers
  • route matches the current route string
  • Log not emitted when timing data is unavailable

ETA: 12 hours


Coordinate on Telegram

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave program

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions