diff --git a/package-lock.json b/package-lock.json index e430588..13e858e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@stassi/leaf", - "version": "0.0.59", + "version": "0.0.60", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@stassi/leaf", - "version": "0.0.59", + "version": "0.0.60", "cpu": [ "arm64", "x64" diff --git a/package.json b/package.json index eb3528c..2bd077e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@stassi/leaf", - "version": "0.0.59", + "version": "0.0.60", "description": "Leaflet adapter.", "keywords": [ "cartography", diff --git a/src/tutorial/accessibility/interactive.test.ts b/src/tutorial/accessibility/interactive.test.ts index 15f22d0..1d1b096 100644 --- a/src/tutorial/accessibility/interactive.test.ts +++ b/src/tutorial/accessibility/interactive.test.ts @@ -4,25 +4,6 @@ describe('interactive accessibility tutorial', (): void => { }) describe('map', (): void => { - describe('on initial page load', (): void => { - // eslint-disable-next-line jest/prefer-lowercase-title -- official case - describe('OpenStreetMap tiles', (): void => { - it('should render', async (): Promise => { - ;( - await page.$$eval( - '.leaflet-tile-loaded', - (tiles: Element[]): (string | null)[] => - tiles.map((tile: Element): string | null => - tile.getAttribute('src'), - ), - ) - ).forEach((source: string | null): void => { - expect(source).toMatch(/^https:\/\/tile\.openstreetmap\.org\//) - }) - }) - }) - }) - describe('"Tab"-focused marker when "Enter" is pressed', (): void => { it('should display popup text "Kyiv, Ukraine is the birthplace of Leaflet!"', async (): Promise => { let markerFocused = false diff --git a/src/tutorial/custom-icons/custom-icons.test.ts b/src/tutorial/custom-icons/custom-icons.test.ts index d2ee859..b1ba6e1 100644 --- a/src/tutorial/custom-icons/custom-icons.test.ts +++ b/src/tutorial/custom-icons/custom-icons.test.ts @@ -4,25 +4,6 @@ describe('custom icons tutorial', (): void => { }) describe('map', (): void => { - describe('on initial page load', (): void => { - // eslint-disable-next-line jest/prefer-lowercase-title -- official case - describe('OpenStreetMap tiles', (): void => { - it('should render', async (): Promise => { - ;( - await page.$$eval( - '.leaflet-tile-loaded', - (tiles: Element[]): (string | null)[] => - tiles.map((tile: Element): string | null => - tile.getAttribute('src'), - ), - ) - ).forEach((source: string | null): void => { - expect(source).toMatch(/^https:\/\/tile\.openstreetmap\.org\//) - }) - }) - }) - }) - describe('element displays popup text on click', (): void => { describe('markers with custom icons', (): void => { describe.each([ diff --git a/src/tutorial/mobile/mobile.test.ts b/src/tutorial/mobile/mobile.test.ts index 5b6de4b..a5415a8 100644 --- a/src/tutorial/mobile/mobile.test.ts +++ b/src/tutorial/mobile/mobile.test.ts @@ -14,23 +14,6 @@ describe('mobile tutorial', (): void => { }) describe('map', (): void => { - // eslint-disable-next-line jest/prefer-lowercase-title -- official case - describe('OpenStreetMap tiles', (): void => { - it('should render', async (): Promise => { - ;( - await page.$$eval( - '.leaflet-tile-loaded', - (tiles: Element[]): (string | null)[] => - tiles.map((tile: Element): string | null => - tile.getAttribute('src'), - ), - ) - ).forEach((source: string | null): void => { - expect(source).toMatch(/^https:\/\/tile\.openstreetmap\.org\//) - }) - }) - }) - describe('layer', (): void => { describe('circle', (): void => { it('should render', async (): Promise => { diff --git a/src/tutorial/open-street-map-tiles.test.ts b/src/tutorial/open-street-map-tiles.test.ts new file mode 100644 index 0000000..adc895e --- /dev/null +++ b/src/tutorial/open-street-map-tiles.test.ts @@ -0,0 +1,24 @@ +// eslint-disable-next-line jest/prefer-lowercase-title -- official case +describe('OpenStreetMap tiles', (): void => { + describe.each([ + 'accessibility/interactive', + 'custom-icons/custom-icons', + 'mobile/mobile', + 'quick-start/quick-start', + ])('tutorial: %s', (path: string): void => { + it('should render', async (): Promise => { + await page.goto(`http://localhost:3001/tutorial/${path}`) + ;( + await page.$$eval( + '.leaflet-tile-loaded', + (tiles: Element[]): (string | null)[] => + tiles.map((tile: Element): string | null => + tile.getAttribute('src'), + ), + ) + ).forEach((source: string | null): void => { + expect(source).toMatch(/^https:\/\/tile\.openstreetmap\.org\//) + }) + }) + }) +}) diff --git a/src/tutorial/quick-start/quick-start.test.ts b/src/tutorial/quick-start/quick-start.test.ts index af5c800..fbbde86 100644 --- a/src/tutorial/quick-start/quick-start.test.ts +++ b/src/tutorial/quick-start/quick-start.test.ts @@ -7,23 +7,6 @@ describe('quick start tutorial', (): void => { describe('map', (): void => { describe('on initial page load', (): void => { - // eslint-disable-next-line jest/prefer-lowercase-title -- official case - describe('OpenStreetMap tiles', (): void => { - it('should render', async (): Promise => { - ;( - await page.$$eval( - '.leaflet-tile-loaded', - (tiles: Element[]): (string | null)[] => - tiles.map((tile: Element): string | null => - tile.getAttribute('src'), - ), - ) - ).forEach((source: string | null): void => { - expect(source).toMatch(/^https:\/\/tile\.openstreetmap\.org\//) - }) - }) - }) - describe('standalone popup', (): void => { it('should display text "I am a standalone popup."', async (): Promise => { expect(