Skip to content

Commit

Permalink
Merge pull request #60 from Stassi/feature/unified-open-street-map-ti…
Browse files Browse the repository at this point in the history
…les-test

feature/unified-open-street-map-tiles-test
  • Loading branch information
Stassi authored Oct 11, 2024
2 parents 4c7e9ae + ef5aa2f commit 22e4eb0
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 75 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@stassi/leaf",
"version": "0.0.59",
"version": "0.0.60",
"description": "Leaflet adapter.",
"keywords": [
"cartography",
Expand Down
19 changes: 0 additions & 19 deletions src/tutorial/accessibility/interactive.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<void> => {
;(
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<void> => {
let markerFocused = false
Expand Down
19 changes: 0 additions & 19 deletions src/tutorial/custom-icons/custom-icons.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<void> => {
;(
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([
Expand Down
17 changes: 0 additions & 17 deletions src/tutorial/mobile/mobile.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<void> => {
;(
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<void> => {
Expand Down
24 changes: 24 additions & 0 deletions src/tutorial/open-street-map-tiles.test.ts
Original file line number Diff line number Diff line change
@@ -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<void> => {
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\//)
})
})
})
})
17 changes: 0 additions & 17 deletions src/tutorial/quick-start/quick-start.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<void> => {
;(
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<void> => {
expect(
Expand Down

0 comments on commit 22e4eb0

Please sign in to comment.