Skip to content

Test Data & Seeding ​

Every integration test starts with a fully seeded database. The seeding is orchestrated by seedTestDatabase() in test/utils/seed-test-data.ts.

Seeding pipeline ​

Fixtures ​

Fixture definitions live in test/fixtures/ and are self-documenting β€” read the files directly for the full list of available users, companies, and configurations.

Accessing seeded data in tests ​

The seedResult object is available after beforeAll and gives you typed access to all seeded IDs:

typescript
// Company IDs
const companyId = test.seedResult.companies.get('Green Valley Farm');

// Seeded users
const users = test.seedResult.users;

// Workspace IDs
const fieldWorkspaceId = test.seedResult.workspaceIds.fieldWorkspaceId;

// Parse result reference IDs (for reference resolution assertions)
const blockCRefId = test.seedResult.parseResultRefIds['Block C'];
expect(entry.field[0].refId).toBe(blockCRefId.toString());

Skipping the seed ​

If your test creates its own data (e.g. auth registration tests), skip the standard seed:

typescript
const testContext = new BaseIntegrationTest({ seed: { enabled: false } });