Skip to content

Commit

Permalink
Merge pull request #185 from City-of-Turku/develop
Browse files Browse the repository at this point in the history
Release v1.6.0
  • Loading branch information
juhomakkonen authored Jun 15, 2023
2 parents 24f69b1 + 30fc361 commit 765ae33
Show file tree
Hide file tree
Showing 365 changed files with 3,398 additions and 2,674 deletions.
4 changes: 2 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ MODE=development

#ACCESSIBILITY_SENTENCE_API="https://www.hel.fi/palvelukarttaws/rest/v4"
SERVICEMAP_API="https://palvelukartta-api.turku.fi/api/v2"
#EVENTS_API="https://linkedevents-api.turku.fi/v1"
#RESERVATIONS_API="https://api.hel.fi/respa/v1"
EVENTS_API="https://linkedevents-api.turku.fi/v1"
RESERVATIONS_API="https://respa.turku.fi/v1"
FEEDBACK_URL="https://palvelukartta-api.turku.fi/open311/"
DIGITRANSIT_API="https://api.digitransit.fi/routing/v2/routers/waltti/index/graphql"
#HEARING_MAP_API="https://kuulokuvat.fi/api/v1/servicemap-url"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:

strategy:
matrix:
node-version: [12.x, 14.x]
node-version: [14.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
Expand Down
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v14.17.6
31 changes: 13 additions & 18 deletions browserTests/generic/mapTest.js
Original file line number Diff line number Diff line change
@@ -1,32 +1,27 @@
import { waitForReact, ReactSelector } from 'testcafe-react-selectors';
import { waitForReact } from 'testcafe-react-selectors';
import config from '../config';
import { Selector } from 'testcafe';

/* eslint-disable */
const { server } = config;

fixture`Search unit geometry test`
.page`http://${server.address}:${server.port}/fi/search?q=latu`
.beforeEach(async () => {
fixture`Search unit geometry test`.page`http://${server.address}:${server.port}/fi/search?q=latu`.beforeEach(
async () => {
await waitForReact();
});
},
);

test('Unit geometry is drawn on map', async (t) => {
test('Unit geometry is drawn on map', async t => {
const polygon = Selector('.leaflet-pane .leaflet-overlay-pane').find('canvas');
const listItem = Selector('#paginatedList-Toimipisteet-results li[role="link"]').nth(0);
await t
.click(listItem)
.expect(polygon.exists).ok('Unit geometry not drawn on map');
await t.click(listItem).expect(polygon.exists).ok('Unit geometry not drawn on map');
});

fixture`Unit page geometry test`
.page`http://${server.address}:${server.port}/fi/unit/56544`
.beforeEach(async () => {
await waitForReact();
});
fixture`Unit page geometry test`.page`http://${server.address}:${server.port}/fi/unit/56544`.beforeEach(async () => {
await waitForReact();
});

test('Unit geometry is drawn on map', async (t) => {
test('Unit geometry is drawn on map', async t => {
const polygon = Selector('.leaflet-pane .leaflet-overlay-pane').find('canvas');
await t
.expect(polygon.exists).ok();
});
await t.expect(polygon.exists).ok();
});
2 changes: 1 addition & 1 deletion browserTests/views/addressTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ test('AddressView does render correct view', async (t) => {
const tab2Text = await tab2.textContent;

await t
.expect(title).eql('Linnankatu 14')
.expect(title).eql('Linnankatu 10')
.expect(tab1).eql('Palvelualueet')
.expect(tab2Text.indexOf('Lähellä')).eql(0, 'Tab text should include text "Lähellä"')
;
Expand Down
7 changes: 7 additions & 0 deletions client/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import * as Sentry from '@sentry/react';
import ac from 'abortcontroller-polyfill';
import 'core-js/stable';
import StyleContext from 'isomorphic-style-loader/StyleContext';
import { CacheProvider } from '@emotion/react';
import React from 'react';
import ReactDOM from 'react-dom';
import { Helmet } from 'react-helmet';
Expand All @@ -17,6 +18,7 @@ import favicon from '../src/assets/icons/favicon.ico';
import rootReducer from '../src/redux/rootReducer';
import LocalStorageUtility from '../src/utils/localStorage';
import SettingsUtility from '../src/utils/settings';
import createEmotionCache from '../server/createEmotionCache';

if (config.sentryDSN) {
Sentry.init({
Expand Down Expand Up @@ -66,6 +68,9 @@ const insertCss = (...styles) => {
return () => removeCss.forEach(dispose => dispose());
};

// Create cache object which will inject emotion styles from cache
const cache = createEmotionCache();

function Main() {
// Remove server side styles
React.useEffect(() => {
Expand All @@ -76,6 +81,7 @@ function Main() {
}, []);

return (
<CacheProvider value={cache}>
<Provider store={store}>
{/* Provider to help with isomorphic style loader */}
<StyleContext.Provider value={{ insertCss }}>
Expand All @@ -88,6 +94,7 @@ function Main() {
<App />
</StyleContext.Provider>
</Provider>
</CacheProvider>
);
}

Expand Down
6 changes: 3 additions & 3 deletions jestUtils.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { MuiThemeProvider } from '@material-ui/core';
import { ThemeProvider } from '@mui/material/styles';
import { render } from '@testing-library/react';
import React from 'react';
import { IntlProvider } from 'react-intl';
Expand All @@ -21,9 +21,9 @@ const Providers = (mockState) => ({ children }) => {
return (
<Provider store={store}>
<IntlProvider {...intlMock}>
<MuiThemeProvider theme={themes.SMTheme}>
<ThemeProvider theme={themes.SMTheme}>
{children}
</MuiThemeProvider>
</ThemeProvider>
</IntlProvider>
</Provider>
);
Expand Down
Loading

0 comments on commit 765ae33

Please sign in to comment.