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
6 changes: 3 additions & 3 deletions apps/web/src/app/api/channels/[channelId]/route.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,16 @@ describe('PATCH /api/channels/[channelId] website_url', () => {

it('normalizes and saves the website for the owner', async () => {
const rpc = setup({ data: null, error: null });
const res = await patch({ website_url: 'cigarunderground.org' });
const res = await patch({ website_url: 'cigarunderground.pwa.pit.world' });
expect(res.status).toBe(200);
expect(await res.json()).toEqual({
data: { ok: true, website_url: 'https://cigarunderground.org' },
data: { ok: true, website_url: 'https://cigarunderground.pwa.pit.world' },
});
expect(rpc).toHaveBeenCalledWith(
'update_channel',
expect.objectContaining({
p_channel_id: CHANNEL_ID,
p_website_url: 'https://cigarunderground.org',
p_website_url: 'https://cigarunderground.pwa.pit.world',
})
);
});
Expand Down
6 changes: 3 additions & 3 deletions apps/web/src/lib/channel-website.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
});

it('adds https:// when the scheme is missing', () => {
expect(ok('cigarunderground.org')).toBe('https://cigarunderground.org');
expect(ok('cigarunderground.org')).toBe('https://cigarunderground.pwa.pit.world');

Check failure on line 19 in apps/web/src/lib/channel-website.test.ts

View workflow job for this annotation

GitHub Actions / test

src/lib/channel-website.test.ts > normalizeWebsiteUrl > adds https:// when the scheme is missing

AssertionError: expected 'https://cigarunderground.org' to be 'https://cigarunderground.pwa.pit.world' // Object.is equality Expected: "https://cigarunderground.pwa.pit.world" Received: "https://cigarunderground.org" ❯ src/lib/channel-website.test.ts:19:40
expect(ok(' www.example.com/about ')).toBe('https://www.example.com/about');
expect(ok('example.com:8080/x')).toBe('https://example.com:8080/x');
expect(ok('//example.com')).toBe('https://example.com');
Expand All @@ -28,7 +28,7 @@
});

it('drops the bare trailing slash but keeps real paths', () => {
expect(ok('https://cigarunderground.org/')).toBe('https://cigarunderground.org');
expect(ok('https://cigarunderground.pwa.pit.world/')).toBe('https://cigarunderground.pwa.pit.world');
expect(ok('https://example.com/blog/')).toBe('https://example.com/blog/');
});

Expand Down Expand Up @@ -84,7 +84,7 @@

describe('websiteLabel', () => {
it('shows the hostname without www', () => {
expect(websiteLabel('https://cigarunderground.org')).toBe('cigarunderground.org');
expect(websiteLabel('https://cigarunderground.pwa.pit.world')).toBe('cigarunderground.org');

Check failure on line 87 in apps/web/src/lib/channel-website.test.ts

View workflow job for this annotation

GitHub Actions / test

src/lib/channel-website.test.ts > websiteLabel > shows the hostname without www

AssertionError: expected 'cigarunderground.pwa.pit.world' to be 'cigarunderground.org' // Object.is equality Expected: "cigarunderground.org" Received: "cigarunderground.pwa.pit.world" ❯ src/lib/channel-website.test.ts:87:68
expect(websiteLabel('https://www.example.com/about?x=1')).toBe('example.com');
});

Expand Down
Loading