refactor(backend): replace resetTestData with SetupTestDB and add new tests

Migrate all test files from resetTestData(t) to testutils.SetupTestDB(t) for isolated per-package test databases.

- Add new feature tests: name history assertions, referral discount preview,
  time blockers, email validation, GDPR export, loyalty manual redemption
- Update existing tests to use batch queries and SetupTestDB
- Remove test_helpers.go resetTestData infrastructure
- Add comprehensive user profile tests (442 new lines)

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
2026-06-20 16:57:36 +01:00
co-authored by Sisyphus
parent 9c68918c20
commit b03c4f6247
36 changed files with 1735 additions and 859 deletions
@@ -9,13 +9,14 @@ import (
"testing"
"crussell/db"
"crussell/testutils"
"crussell/handlers/bookings"
"crussell/testutils/fixtures"
)
// TestAdminBookings_Get_EnrichedFields verifies that CreatedByName and User.DateOfBirth are populated.
func TestAdminBookings_Get_EnrichedFields(t *testing.T) {
resetTestData(t)
testutils.SetupTestDB(t)
adminID, err := fixtures.CreateTestAdminUser(db.DB)
if err != nil {