docs(service-worker): improve SwRegistrationOptions
docs and add example (#21842)
PR Close #21842
This commit is contained in:

committed by
Andrew Kushnir

parent
be28a6ad8e
commit
aa53d6cc6d
@ -0,0 +1,27 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright Google Inc. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
import {browser, by, element} from 'protractor';
|
||||
import {verifyNoBrowserErrors} from '../../../test-utils';
|
||||
|
||||
describe('SW `SwRegistrationOptions` example', () => {
|
||||
const pageUrl = '/registration-options';
|
||||
const appElem = element(by.css('example-app'));
|
||||
|
||||
afterEach(verifyNoBrowserErrors);
|
||||
|
||||
it('not register the SW by default', () => {
|
||||
browser.get(pageUrl);
|
||||
expect(appElem.getText()).toBe('SW enabled: false');
|
||||
});
|
||||
|
||||
it('register the SW when navigating to `?sw=true`', () => {
|
||||
browser.get(`${pageUrl}?sw=true`);
|
||||
expect(appElem.getText()).toBe('SW enabled: true');
|
||||
});
|
||||
});
|
Reference in New Issue
Block a user