Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature/unified-open-street-map-tiles-test #60

Merged
merged 3 commits into from
Oct 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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