diff --git a/.gitignore b/.gitignore index a7eee278fc5..36ec40526eb 100644 --- a/.gitignore +++ b/.gitignore @@ -50,3 +50,4 @@ generated /reports* /data/page_views_map.json +test-results \ No newline at end of file diff --git a/playwright.config.js b/playwright.config.js deleted file mode 100644 index 4408c53a59e..00000000000 --- a/playwright.config.js +++ /dev/null @@ -1,23 +0,0 @@ -const { devices } = require('@playwright/test'); - -const config = { - forbidOnly: !!process.env.CI, - retries: process.env.CI ? 2 : 0, - reporter: process.env.CI ? 'dot' : 'list', - snapshotDir: 'test/snapshots', - use: { - baseURL: process.env.BASE_URL || 'http://localhost:9000', - trace: 'off', - ignoreHTTPSErrors: true, - }, - projects: [ - { - name: 'chromium', - use: { - ...devices['Desktop Chrome'], - }, - }, - ], -}; - -module.exports = config; diff --git a/playwright.config.ts b/playwright.config.ts new file mode 100644 index 00000000000..6f57f700077 --- /dev/null +++ b/playwright.config.ts @@ -0,0 +1,24 @@ +import { defineConfig, devices } from '@playwright/test'; + +const MAX_DIFF_PIXEL_RATIO = 0.025 as const; + +export default defineConfig({ + forbidOnly: !!process.env.CI, + retries: process.env.CI ? 2 : 0, + reporter: process.env.CI ? 'dot' : 'list', + snapshotDir: 'test/snapshots', + expect: { + toMatchSnapshot: { maxDiffPixelRatio: MAX_DIFF_PIXEL_RATIO }, + toHaveScreenshot: { maxDiffPixelRatio: MAX_DIFF_PIXEL_RATIO } + }, + use: { + baseURL: process.env.BASE_URL || 'http://localhost:9000', + trace: 'off' + }, + projects: [ + { + name: 'chromium', + use: { ...devices['Desktop Chrome'] } + } + ] +}); diff --git a/static/js/ktl-component/courses/index.jsx b/static/js/ktl-component/courses/index.jsx index 24b0aecb612..90316eae13e 100644 --- a/static/js/ktl-component/courses/index.jsx +++ b/static/js/ktl-component/courses/index.jsx @@ -12,7 +12,7 @@ import {TeachMap} from '../teach/components/teach-map/teach-map.jsx'; const Courses = ({universities, path}) => { const [activeIndex, setActiveIndex] = useState(0); return ( -
+
diff --git a/static/js/ktl-component/teach/components/teach-map/teach-map.jsx b/static/js/ktl-component/teach/components/teach-map/teach-map.jsx index 3a17f02851a..a6a4ee7603d 100644 --- a/static/js/ktl-component/teach/components/teach-map/teach-map.jsx +++ b/static/js/ktl-component/teach/components/teach-map/teach-map.jsx @@ -22,7 +22,7 @@ export const TeachMap = ({className}) => { const items = data.map(university => { return { ...university, - id: `${university.title}-${university.location}` + id: `${university.title}-${university.location}-${university.geo.lat}-${university.geo.lng}` } }); setUniversities(items) diff --git a/static/js/ktl-component/teach/index.jsx b/static/js/ktl-component/teach/index.jsx index 52706e43674..93c1f232ff4 100644 --- a/static/js/ktl-component/teach/index.jsx +++ b/static/js/ktl-component/teach/index.jsx @@ -15,7 +15,7 @@ import './style.scss'; import {SubscriptionForm} from './components/subscription-form'; import {TeachMap} from './components/teach-map/teach-map.jsx'; import {SlackIcon} from "@rescui/icons"; -import Button from "@rescui/button"; +import { Button } from "@rescui/button"; import { TeachLaunchCourse } from "./components/teach-launch-course"; import { useTextStyles } from '@rescui/typography'; @@ -41,7 +41,7 @@ const Teach = (props) => { rel="noopener" className="teach-cta-block-button" > - Join Educators Сommunity + Join Educators Community