Skip to content

Commit

Permalink
chore: update testing fakes
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 578330666
  • Loading branch information
awmack authored and copybara-github committed Nov 6, 2023
1 parent 1ed2275 commit f22883b
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 9 deletions.
23 changes: 16 additions & 7 deletions src/base/strings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,19 @@ export type StringFunction = (...args: any[]) => string;
*
* The values of this interface may be either plain strings or string functions,
* the latter of which outputs a string based on one or more string parameters.
*
* Naming convention is <COMPONENT>_<DESCRIPTION>, where the first term
* indicates where the string is used and the second term describes its intent.
*/
export declare interface StringLiterals extends
Record<string, string|StringFunction> {
BACK_BUTTON: string;
LOCATOR_ALL_LOCATIONS: string;
LOCATOR_BACK_BUTTON_CTA: string;
LOCATOR_LIST_HEADER: string;
LOCATOR_LIST_SUBHEADING: string;
LOCATOR_LIST_SUBHEADING_WITH_SEARCH: string;
LOCATOR_SEARCH_LOCATION_MARKER_TITLE: string;
LOCATOR_SEARCH_PROMPT: string;
LOCATOR_VIEW_DETAILS: string;
LOCATOR_VIEW_DETAILS_CTA: string;
PLACE_CLEAR_ARIA_LABEL: string;
PLACE_CLOSED: string;
PLACE_CLOSED_PERMANENTLY: string;
Expand Down Expand Up @@ -54,13 +59,17 @@ export declare interface StringLiterals extends
PLACE_TYPE: (placeType: string) => string;
}

/** String literals in the `en-US` locale. */
/**
* String literals in the `en-US` locale.
*/
export const STRING_LITERALS_EN_US: StringLiterals = Object.freeze({
'BACK_BUTTON': 'Back',
'LOCATOR_ALL_LOCATIONS': 'All locations',
'LOCATOR_BACK_BUTTON_CTA': 'Back',
'LOCATOR_LIST_HEADER': 'Find a location near you',
'LOCATOR_LIST_SUBHEADING': 'All locations',
'LOCATOR_LIST_SUBHEADING_WITH_SEARCH': 'Nearest locations',
'LOCATOR_SEARCH_LOCATION_MARKER_TITLE': 'My location',
'LOCATOR_SEARCH_PROMPT': 'Enter your address or zip code',
'LOCATOR_VIEW_DETAILS': 'View details',
'LOCATOR_VIEW_DETAILS_CTA': 'View details',
'PLACE_CLEAR_ARIA_LABEL': 'Clear',
'PLACE_CLOSED': 'Closed',
'PLACE_CLOSED_PERMANENTLY': 'Permanently closed',
Expand Down
2 changes: 1 addition & 1 deletion src/testing/fake_gmp_components.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export class FakeMapElement extends LitElement {
center: LatLng|LatLngLiteral|null = null;

readonly innerMap =
jasmine.createSpyObj<google.maps.Map>('Map', ['fitBounds']);
jasmine.createSpyObj<google.maps.Map>('Map', ['fitBounds', 'panTo']);

mapId: string|null = null;
zoom: number|null = null;
Expand Down
6 changes: 5 additions & 1 deletion src/testing/fake_google_maps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,11 @@ export class FakeGoogleMapsHarness {
constructor() {
const harness = this;
this.libraries = {
'core': {LatLng: FakeLatLng, LatLngBounds: FakeLatLngBounds},
'core': {
LatLng: FakeLatLng,
LatLngBounds: FakeLatLngBounds,
UnitSystem: {IMPERIAL: 0, METRIC: 1},
},
'maps': {
Map: FakeMapElement,
Polyline: class {
Expand Down

0 comments on commit f22883b

Please sign in to comment.