Skip to content

Commit

Permalink
fix: Added url check for unique map URLs (#23)
Browse files Browse the repository at this point in the history
  • Loading branch information
josebui authored Oct 1, 2024
1 parent eab82e8 commit c1a49c1
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 9 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "1.0.0",
"main": "index.js",
"scripts": {
"lint-js": "eslint ./ --ext .js --ext .ts --ext .tsx --max-warnings 0 --ignore-pattern node_modules/ --ignore-pattern build/",
"lint-js": "eslint ./ --ext .js --ext .ts --ext .tsx --max-warnings 0 --ignore-pattern \"node_modules/, playwright-report/\" --ignore-pattern build/",
"format-js": "npm run lint-js -- --fix"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion src/admin/adminGroupFormPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const confirmRemove = async (page: Page) => {

export const removeGroup = async (page: Page, groupName: string) => {
await groupListPage.goToPage(page);
await groupListPage.showAllGroups(page);
await groupListPage.showLatestGroups(page);
await groupListPage.openGroup(page, groupName);
await remove(page);
await confirmRemove(page);
Expand Down
11 changes: 6 additions & 5 deletions src/admin/adminGroupListPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ export const goToPage = async (page: Page) => {
await page.goto(`${ADMIN_URL}/core/group/`);
};

export const showAllGroups = async (page: Page) => {
const showAll = page.getByRole('link', { name: 'Show all' });
if ((await showAll.count()) > 0) {
await showAll.click();
}
export const showLatestGroups = async (page: Page) => {
await page
.getByRole('link', {
name: /created at/i,
})
.click();
};

export const openGroup = async (page: Page, groupName: string) => {
Expand Down
7 changes: 5 additions & 2 deletions src/sharedData/visualization/visualization.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ const testVisualizationForm = async ({
clip: mapRegionBoundingBox,
},
);

await page.getByRole('button', { name: 'Next' }).click();

// Annotations
Expand Down Expand Up @@ -186,8 +187,10 @@ const testVisualizationForm = async ({

// View page
const url = new URL(page.url());
const expectedPathname = `/groups/${group.slug}/map/${visualizationSlug}`;
expect(url.pathname).toBe(expectedPathname);
const expectedPattern = new RegExp(
`/groups/${group.slug}/map/[\\w-]+/${visualizationSlug}`,
);
expect(url.pathname).toMatch(expectedPattern);
await visualizationFormPage.changeBaseMap(page, 'Satellite');

// Download file
Expand Down

0 comments on commit c1a49c1

Please sign in to comment.