Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion apps/web/src/routes/profiles.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,8 @@ describe('the page', () => {
expect(html).toContain('action="/c/profiles/bob/claim"');
expect(html).toContain('This is me');
expect(html).toContain('Bob <script>');
expect(html).not.toContain('<script>');
// The shared site footer ships its own subscribe <script>; the page above it has none.
expect(html.split('<footer class="pfs-footer"')[0]).not.toContain('<script>');
expect(html).toContain('&lt;b&gt;not bold&lt;/b&gt;');
});

Expand Down
4 changes: 2 additions & 2 deletions apps/web/src/routes/signup-profile.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ describe('signup page', () => {
}
expect(signup).toContain('name="mode" value="signup"');
expect(signup).toContain('/vendor-profile.js');
// One email box, the form's own.
expect(signup.match(/name="email"/g)?.length).toBe(1);
// One email box, the form's own (the shared footer's newsletter box is below it).
expect(signup.split('<footer class="pfs-footer"')[0].match(/name="email"/g)?.length).toBe(1);

const login = await html(SignIn({ mode: 'login' }));
expect(login).not.toContain('name="first_name"');
Expand Down
6 changes: 5 additions & 1 deletion test/sports-schedule.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, expect, test } from 'bun:test';
import { afterAll, beforeAll, describe, expect, setSystemTime, test } from 'bun:test';
import { fixtureItem, scheduleState } from '../packages/adapters/src/sportsdb-live.js';
import {
DAY_CAP,
Expand Down Expand Up @@ -120,6 +120,10 @@ describe('fixtureItem', () => {
});

describe('sportsdbSchedule.pull', () => {
// pull() plans from the real clock; the fixtures are dated around NOW.
beforeAll(() => setSystemTime(new Date(NOW)));
afterAll(() => setSystemTime());

test('does nothing on the shared test key', async () => {
const p = provider();
const out = await run(p, { key: '3' });
Expand Down
3 changes: 2 additions & 1 deletion test/submit-page.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ describe('the submit page', () => {
}),
);
expect(html).toMatch(/<option value="podcasts" selected/);
expect(html).not.toContain('name="email"');
// The shared site footer carries its own newsletter email field.
expect(html.split('<footer class="pfs-footer"')[0]).not.toContain('name="email"');
});

test('echoes a rejected value back as text, not markup', async () => {
Expand Down
Loading