2002db28ff
Now that defferential loading it supported by the cli, remove the obsolete `ie-polyfills.js` (and associated dependencies). All polyfills in `ie-polyfills.js` are now included in the [polyfills-es5][1] bundle, except for `classlist.js`, that is only needed in order to support `NgClass` on SVG elements, which we don't use. [1]: https://github.com/angular/angular-cli/blob/b95933a57/packages/angular_devkit/build_angular/src/angular-cli-files/models/es5-polyfills.js PR Close #29926
39 lines
1.6 KiB
TypeScript
39 lines
1.6 KiB
TypeScript
import { getSwNavigationUrlChecker, loadLegacyUrls, loadLocalSitemapUrls } from '../shared/helpers';
|
|
|
|
describe('ServiceWorker navigation URLs', () => {
|
|
const isNavigationUrl = getSwNavigationUrlChecker();
|
|
|
|
loadLocalSitemapUrls().forEach(url => {
|
|
it('should treat URLs in the Sitemap as navigation URLs', () => {
|
|
expect(isNavigationUrl(url)).toBeTruthy(url);
|
|
});
|
|
});
|
|
|
|
loadLegacyUrls().forEach(urlPair => {
|
|
const url = urlPair[0];
|
|
it('should treat legacy URLs that will be redirected as non-navigation URLs', () => {
|
|
expect(isNavigationUrl(url)).toBeFalsy(url);
|
|
});
|
|
});
|
|
|
|
it('should treat StackBlitz URLs as non-navigation URLs', () => {
|
|
expect(isNavigationUrl('/generated/live-examples/toh-pt6/stackblitz.html')).toBeFalsy();
|
|
expect(isNavigationUrl('/generated/live-examples/toh-pt6/stackblitz')).toBeFalsy();
|
|
});
|
|
|
|
it('should treat URLs to files with extensions as non-navigation URLs', () => {
|
|
expect(isNavigationUrl('/generated/zips/animations/animations.zip')).toBeFalsy();
|
|
expect(isNavigationUrl('/generated/images/guide/animations/animation_auto.gif')).toBeFalsy();
|
|
expect(isNavigationUrl('/generated/ngsw-worker.js')).toBeFalsy();
|
|
expect(isNavigationUrl('/generated/docs/guide/animations.json')).toBeFalsy();
|
|
});
|
|
|
|
it('should treat `/docs*` URLs correctly', () => {
|
|
const navigationUrls = ['/docs', '/docs/'];
|
|
const nonNavigationUrls = ['/docs/foo', '/docs/foo/', '/docs/foo/bar'];
|
|
|
|
navigationUrls.forEach(url => expect(isNavigationUrl(url)).toBeTruthy(url));
|
|
nonNavigationUrls.forEach(url => expect(isNavigationUrl(url)).toBeFalsy(url));
|
|
});
|
|
});
|