Skip to content

Commit

Permalink
PR Feedback:
Browse files Browse the repository at this point in the history
1. Removed .only from two tests (oops)
2. Wrap example titles in <caption>
3. Make it clear in the tests the Request is cross origin
  • Loading branch information
byrichardpowell committed Sep 1, 2023
1 parent a23f054 commit 34199f6
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
} from '../../../__test-helpers';

describe('JWT validation', () => {
it.only('logs that the method is deprecated', async () => {
it('logs that the method is deprecated', async () => {
// GIVEN
const config = testConfig();
const shopify = shopifyApp(config);
Expand Down Expand Up @@ -56,7 +56,7 @@ describe('JWT validation', () => {

// WHEN
const {cors} = await shopify.authenticate.public(
new Request('https://some-other.origin', {
new Request(APP_URL, {
headers: {
Origin: 'https://some-other.origin',
Authorization: `Bearer ${token}`,
Expand Down Expand Up @@ -94,7 +94,7 @@ describe('JWT validation', () => {
// GIVEN
const shopify = shopifyApp(testConfig());
const {token} = getJwt();
const request = new Request('https://some-other.origin', {
const request = new Request(APP_URL, {
method: 'OPTIONS',
headers: {
Origin: 'https://some-other.origin',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ describe('authenticating app proxy requests', () => {
expect(response.statusText).toBe('Bad Request');
});

it.only('Throws a 400 response if the signature param is incorrect', async () => {
it('Throws a 400 response if the signature param is incorrect', async () => {
// GIVEN
const shopify = shopifyApp(testConfig());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ describe('JWT validation', () => {

// WHEN
const {cors} = await shopify.authenticate.public.checkout(
new Request('https://some-other.origin', {
new Request(APP_URL, {
headers: {
Origin: 'https://some-other.origin',
Authorization: `Bearer ${token}`,
Expand Down Expand Up @@ -70,7 +70,7 @@ describe('JWT validation', () => {
// GIVEN
const shopify = shopifyApp(testConfig());
const {token} = getJwt();
const request = new Request('https://some-other.origin', {
const request = new Request(APP_URL, {
method: 'OPTIONS',
headers: {
Origin: 'https://some-other.origin',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export interface CheckoutContext {
* The payload of the Session Token is described here: {@link https://shopify.dev/docs/apps/auth/oauth/session-tokens#payload}
*
* @example
* Getting your app's store specific widget data using the session token
* <caption>Get store specific widget data using the session token</caption>
* ```ts
* // app/routes/public/widgets.ts
* import { LoaderArgs, json } from "@remix-run/node";
Expand All @@ -42,7 +42,7 @@ export interface CheckoutContext {
* A function that ensures the CORS headers are set correctly for the response
*
* @example
* Setting CORS headers for a public request
* <caption>Setting CORS headers for a public request</caption>
* ```ts
* // app/routes/public/widgets.ts
* import { LoaderArgs, json } from "@remix-run/node";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export type AuthenticatePublic = AuthenticateCheckout & {
* Authenticate a request from a checkout extension
*
* @example
* Authenticating a checkout extension request
* <caption>Authenticating a checkout extension request</caption>
* ```ts
* // app/routes/public/widgets.ts
* import { LoaderArgs, json } from "@remix-run/node";
Expand All @@ -44,7 +44,7 @@ export type AuthenticatePublic = AuthenticateCheckout & {
* Authenticate a request from an app proxy
*
* @example
* Authenticating an app proxy request
* <caption>Authenticating an app proxy request</caption>
* ```ts
* // app/routes/public/widgets.ts
* import { LoaderArgs, json } from "@remix-run/node";
Expand Down

0 comments on commit 34199f6

Please sign in to comment.