diff --git a/client/src/www/app/main.ts b/client/src/www/app/main.ts index 3225e94adc..f701d3ba3a 100644 --- a/client/src/www/app/main.ts +++ b/client/src/www/app/main.ts @@ -53,7 +53,10 @@ function getRootEl() { return document.querySelector('app-root') as {} as polymer.Base; } -async function createServerRepo(platform: OutlinePlatform, eventQueue: EventQueue): Promise { +async function createServerRepo( + platform: OutlinePlatform, + eventQueue: EventQueue +): Promise { const localize = getLocalizationFunction(); const vpnApi = platform.getVpnApi(); if (vpnApi) { diff --git a/client/src/www/app/outline_server_repository/config.ts b/client/src/www/app/outline_server_repository/config.ts index aace959c8a..8ea690de58 100644 --- a/client/src/www/app/outline_server_repository/config.ts +++ b/client/src/www/app/outline_server_repository/config.ts @@ -33,7 +33,10 @@ export type ServiceConfig = StaticServiceConfig | DynamicServiceConfig; * It's the structured representation of a Static Access Key. */ export class StaticServiceConfig { - constructor(readonly name: string, readonly tunnelConfig: TunnelConfigJson) {} + constructor( + readonly name: string, + readonly tunnelConfig: TunnelConfigJson + ) {} } /** @@ -41,7 +44,10 @@ export class StaticServiceConfig { * It's the structured representation of a Dynamic Access Key. */ export class DynamicServiceConfig { - constructor(readonly name: string, readonly transportConfigLocation: URL) {} + constructor( + readonly name: string, + readonly transportConfigLocation: URL + ) {} } /** diff --git a/client/src/www/app/outline_server_repository/index.ts b/client/src/www/app/outline_server_repository/index.ts index 00bdfced4c..11923f8264 100644 --- a/client/src/www/app/outline_server_repository/index.ts +++ b/client/src/www/app/outline_server_repository/index.ts @@ -302,4 +302,4 @@ async function loadServersV1(storage: Storage, repo: OutlineServerRepository) { console.error(e); } } -} \ No newline at end of file +} diff --git a/client/src/www/views/contact_view/support_form/index.spec.ts b/client/src/www/views/contact_view/support_form/index.spec.ts index 0fcdc21f7c..15dfbbcb43 100644 --- a/client/src/www/views/contact_view/support_form/index.spec.ts +++ b/client/src/www/views/contact_view/support_form/index.spec.ts @@ -16,11 +16,17 @@ import {TextField} from '@material/mwc-textfield'; -import {fixture, html, nextFrame, oneEvent, triggerBlurFor, triggerFocusFor} from '@open-wc/testing'; +import { + fixture, + html, + nextFrame, + oneEvent, + triggerBlurFor, + triggerFocusFor, +} from '@open-wc/testing'; import {FormValues, SupportForm} from './index'; - async function setValue(el: TextField, value: string) { await triggerFocusFor(el); el.value = value; @@ -42,21 +48,35 @@ describe('SupportForm', () => { description: 'Test Description', outreachConsent: false, }; - const el = await fixture(html` `); + const el = await fixture(html` + + `); - const emailInput: TextField = el.shadowRoot!.querySelector('mwc-textfield[name="email"')!; + const emailInput: TextField = el.shadowRoot!.querySelector( + 'mwc-textfield[name="email"' + )!; expect(emailInput.value).toBe('foo@bar.com'); - const accessKeySourceInput: TextField = el.shadowRoot!.querySelector('mwc-textfield[name="accessKeySource"')!; + const accessKeySourceInput: TextField = el.shadowRoot!.querySelector( + 'mwc-textfield[name="accessKeySource"' + )!; expect(accessKeySourceInput.value).toBe('a friend'); - const subjectInput: TextField = el.shadowRoot!.querySelector('mwc-textfield[name="subject"')!; + const subjectInput: TextField = el.shadowRoot!.querySelector( + 'mwc-textfield[name="subject"' + )!; expect(subjectInput.value).toBe('Test Subject'); - const descriptionInput: TextField = el.shadowRoot!.querySelector('mwc-textarea[name="description"')!; + const descriptionInput: TextField = el.shadowRoot!.querySelector( + 'mwc-textarea[name="description"' + )!; expect(descriptionInput.value).toBe('Test Description'); }); it('updating the `values` property updates the form', async () => { - const el: SupportForm = await fixture(html` `); - const emailInput: TextField = el.shadowRoot!.querySelector('mwc-textfield[name="email"')!; + const el: SupportForm = await fixture(html` + + `); + const emailInput: TextField = el.shadowRoot!.querySelector( + 'mwc-textfield[name="email"' + )!; await setValue(emailInput, 'foo@bar.com'); el.values = {}; @@ -67,7 +87,9 @@ describe('SupportForm', () => { it('submit button is disabled by default', async () => { const el = await fixture(html` `); - const submitButton = el.shadowRoot!.querySelectorAll('mwc-button')[1] as HTMLElement; + const submitButton = el.shadowRoot!.querySelectorAll( + 'mwc-button' + )[1] as HTMLElement; expect(submitButton.hasAttribute('disabled')).toBeTrue(); }); @@ -78,16 +100,26 @@ describe('SupportForm', () => { beforeEach(async () => { el = await fixture(html` `); - const emailInput: TextField = el.shadowRoot!.querySelector('mwc-textfield[name="email"')!; + const emailInput: TextField = el.shadowRoot!.querySelector( + 'mwc-textfield[name="email"' + )!; await setValue(emailInput, 'foo@bar.com'); - const accessKeySourceInput: TextField = el.shadowRoot!.querySelector('mwc-textfield[name="accessKeySource"')!; + const accessKeySourceInput: TextField = el.shadowRoot!.querySelector( + 'mwc-textfield[name="accessKeySource"' + )!; await setValue(accessKeySourceInput, 'From a friend'); - const subjectInput: TextField = el.shadowRoot!.querySelector('mwc-textfield[name="subject"')!; + const subjectInput: TextField = el.shadowRoot!.querySelector( + 'mwc-textfield[name="subject"' + )!; await setValue(subjectInput, 'Test Subject'); - const descriptionInput: TextField = el.shadowRoot!.querySelector('mwc-textarea[name="description"')!; + const descriptionInput: TextField = el.shadowRoot!.querySelector( + 'mwc-textarea[name="description"' + )!; await setValue(descriptionInput, 'Test Description'); - submitButton = el.shadowRoot!.querySelectorAll('mwc-button')[1] as HTMLElement; + submitButton = el.shadowRoot!.querySelectorAll( + 'mwc-button' + )[1] as HTMLElement; }); it('submit button is enabled', async () => { @@ -105,10 +137,14 @@ describe('SupportForm', () => { }); it('emits form cancel event', async () => { - const el: SupportForm = await fixture(html` `); + const el: SupportForm = await fixture(html` + + `); const listener = oneEvent(el, 'cancel'); - const cancelButton = el.shadowRoot!.querySelectorAll('mwc-button')[0] as HTMLElement; + const cancelButton = el.shadowRoot!.querySelectorAll( + 'mwc-button' + )[0] as HTMLElement; cancelButton.click(); const {detail} = await listener;