Skip to content

Commit

Permalink
chore(tests): add extra tests for some edge specific headers
Browse files Browse the repository at this point in the history
  • Loading branch information
maxholman committed Aug 1, 2024
1 parent 69413c2 commit d3fc2d0
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/web-push/test/push.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { describe, expect, test } from 'vitest';
import { buildPushPayload, type PushMessage } from '../lib/main.js';
import { fakeSubscriptions, fakeVapid } from './fixtures.js';

describe('Payload', () => {
describe('Payload Integration', () => {
test('Fake Chrome Subscription', async () => {
const message: PushMessage = {
data: 'Some text',
Expand Down Expand Up @@ -30,7 +30,7 @@ describe('Payload', () => {
data: 'Some text',
options: {
ttl: 60,
// Topics are strings that can be used to replace a pending messages with
// Topics are strings that can be used to replace pending messages with
// a new message if they have matching topic names
topic: 'from-test-env',
urgency: 'high',
Expand All @@ -45,5 +45,9 @@ describe('Payload', () => {
await expect(res.text()).resolves.toMatchInlineSnapshot('""');
expect(res.statusText).toMatchInlineSnapshot('"Created"');
expect(res.status).toMatchInlineSnapshot('201');

// seemingly Edge specific headers, static so we can check them here
expect(res.headers.get('x-wns-notificationstatus')).toBe('received');
expect(res.headers.get('x-wns-status')).toBe('received');
});
});

0 comments on commit d3fc2d0

Please sign in to comment.