Skip to content
This repository has been archived by the owner on Oct 1, 2024. It is now read-only.

Remove SUPPORTED_LOCALES from address-consts #1562

Merged
merged 1 commit into from
Jul 27, 2020
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
13 changes: 0 additions & 13 deletions packages/address-consts/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,16 +101,3 @@ export const HEADERS = {
'Content-Type': 'application/json',
'Access-Control-Allow-Origin': '*',
};

export const SUPPORTED_LOCALES = [
'DA',
'DE',
'EN',
'ES',
'FR',
'IT',
'JA',
'NL',
'PT',
'PT_BR',
];
18 changes: 15 additions & 3 deletions packages/address-mocks/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {GRAPHQL_ENDPOINT, SUPPORTED_LOCALES} from '@shopify/address-consts';
import {GRAPHQL_ENDPOINT} from '@shopify/address-consts';
import {fetch} from '@shopify/jest-dom-mocks';

import {fixtures} from './fixtures';
Expand All @@ -11,8 +11,20 @@ interface Options {
}

export function mockCountryRequests() {
const unsupportedLocales = ['AF'];
SUPPORTED_LOCALES.concat(unsupportedLocales).map(locale => {
const locales = [
'AF',
'DA',
'DE',
'EN',
'ES',
'FR',
'IT',
'JA',
'NL',
'PT',
'PT_BR',
];
locales.concat(locales).map(locale => {
['countries', 'country'].map(operationName => {
fetch.mock(
(url: string, options: Options) => {
Expand Down