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

deps: bump react-router-dom to 6.28.0 HAUKI-672 #420

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
11 changes: 5 additions & 6 deletions e2e/tests/resource-page.spec.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
// eslint-disable-next-line import/no-extraneous-dependencies
import { Page, expect, test } from '@playwright/test';
import { getResource, getResourceUrl } from '../utils';
import { Resource } from '../../src/common/lib/types';
import { getResourceUrl, getResource } from '../utils';

import { testData } from '../constants';
import { Resource } from '../../src/common/lib/types';

test.describe('Resource page', async () => {
let page: Page;
let resourceUrl: string;
let resource: Resource;

test.beforeAll(async ({ browser }) => {
resourceUrl = await getResourceUrl();
resource = await getResource();
resourceUrl = await getResourceUrl();

page = await browser.newPage();
await page.goto(resourceUrl);
Expand Down Expand Up @@ -40,6 +41,7 @@ test.describe('Resource page', async () => {

test('Location name', async () => {
const resourceTitle = resource.name.fi;

await expect(page.getByText(resourceTitle)).toBeVisible();
});

Expand Down Expand Up @@ -174,10 +176,7 @@ test.describe('Resource page', async () => {
});

test('Dates - day selection', async () => {
const createNewPeriodUrl = `/resource/${resource.id}/period/new`;

await page.getByRole('button', { name: 'Lisää aukioloaika +' }).click();
await page.goto(createNewPeriodUrl);

await page
.getByLabel('Aukiolomääritys 1')
Expand Down
3 changes: 3 additions & 0 deletions e2e/utils.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import { promisify } from 'util';
import { exec } from 'child_process';
import dns from 'node:dns';
import { DatePeriod, Resource } from '../src/common/lib/types';
import { apiUrl, testData } from './constants';

dns.setDefaultResultOrder('ipv4first');

const getAuthParams = async () => {
const execAsync = promisify(exec);

Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"@testing-library/user-event": "^12.2.2",
"@types/jest": "^26.0.24",
"@types/lodash": "4.14.192",
"@types/node": "^12.20.37",
"@types/node": "^22.10.2",
"@types/react": "^17.0.1",
"@types/react-dom": "^17.0.1",
"@types/react-router-dom": "^5.3.2",
Expand Down Expand Up @@ -43,7 +43,7 @@
"react-dom": "^17.0.1",
"react-hook-form": "7.34.2",
"react-i18next": "^13.5.0",
"react-router-dom": "^5.2.0",
"react-router-dom": "^6.28.0",
"react-test-renderer": "^16.13.1",
"sass": "^1.77.2",
"typescript": "4.9.5",
Expand Down
13 changes: 10 additions & 3 deletions playwright.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// eslint-disable-next-line import/no-extraneous-dependencies
import { defineConfig } from '@playwright/test';
import { defineConfig, devices } from '@playwright/test';
import { e2eTestUrl } from './e2e/constants';

export default defineConfig({
Expand All @@ -11,6 +11,9 @@ export default defineConfig({
/* Fail the build on CI if you accidentally left test.only in the source code. */
forbidOnly: !!process.env.CI,

/* The maximum number of retry attempts given to failed tests */
retries: process.env.CI ? 1 : undefined,

// Timeout for each test in milliseconds
timeout: 60 * 1000,

Expand Down Expand Up @@ -49,8 +52,12 @@ export default defineConfig({

projects: [
{
name: 'Tests',
testMatch: [/tests/],
name: 'chromium',
use: { ...devices['Desktop Chrome'] },
},
{
name: 'firefox',
use: { ...devices['Desktop Firefox'] },
},
],
globalTeardown: require.resolve('./e2e/tests/global.teardown.ts'),
Expand Down
Loading