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

63-refactor: migrate to fsd #311

Merged
merged 58 commits into from
Jun 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
f78fdf6
refactor: update playWright screenshots
NikitaStarmoussov Jun 17, 2024
b75eca0
refactor: breadcrumbs to shared
NikitaStarmoussov Jun 17, 2024
ab60e29
refactor: CustomLink to shared
NikitaStarmoussov Jun 17, 2024
9c4d392
refactor: notFound update path CustomLink
NikitaStarmoussov Jun 17, 2024
4737339
refactor: Paragraph to shared
NikitaStarmoussov Jun 17, 2024
52b0eea
refactor: Subtitle to shared
NikitaStarmoussov Jun 17, 2024
9341404
refactor: Title to shared
NikitaStarmoussov Jun 17, 2024
88297fd
refactor: SectionLabel to shared
NikitaStarmoussov Jun 17, 2024
6f167db
refactor: SocialMedia to shared
NikitaStarmoussov Jun 17, 2024
52c94ef
refactor: assets folder to shared
NikitaStarmoussov Jun 17, 2024
08026a2
refactor: update paths
NikitaStarmoussov Jun 17, 2024
715b5e7
refactor: update tests constants
NikitaStarmoussov Jun 17, 2024
0a01133
refactor: util to shared helpers
NikitaStarmoussov Jun 17, 2024
6e6b95b
refactor: hooks folder to shared
NikitaStarmoussov Jun 17, 2024
a30588b
refactor: delete hook, util to course helpers
NikitaStarmoussov Jun 18, 2024
d241676
refactor: update screns tests for 18 june content
NikitaStarmoussov Jun 18, 2024
e4c43cc
feat: change folder dir
NikitaStarmoussov Jun 18, 2024
b7042ba
refactor: app styles to app/styles
NikitaStarmoussov Jun 18, 2024
43cc446
refactor: __tests__ to shared
NikitaStarmoussov Jun 18, 2024
e888fe1
refactor: update paths for tests
NikitaStarmoussov Jun 18, 2024
1c8ae4b
refactor: update .gitignore
NikitaStarmoussov Jun 18, 2024
4e0d7d2
63-refactor: src folders to app, shared (#317)
NikitaStarmoussov Jun 18, 2024
4983d7c
refactor: about to widgets
NikitaStarmoussov Jun 18, 2024
0384c87
refactor: about-video to widgets
NikitaStarmoussov Jun 18, 2024
d672dee
refactor: actions to shared
NikitaStarmoussov Jun 18, 2024
b2a1dfd
refactor: breadcrumbs to widgets
NikitaStarmoussov Jun 18, 2024
1a46951
refactor: angular-topics to widgets
NikitaStarmoussov Jun 18, 2024
5bbf507
refactor: base-layout to app/layouts
NikitaStarmoussov Jun 18, 2024
52f9b68
refactor: certification to widgets
NikitaStarmoussov Jun 18, 2024
fba04e9
refactor: communication to widgets
NikitaStarmoussov Jun 18, 2024
00565b1
refactor: course-main to widgets
NikitaStarmoussov Jun 18, 2024
8ac8ae5
refactor: courses to widgets and entities
NikitaStarmoussov Jun 18, 2024
ebd9e18
refactor: courses update widget name
NikitaStarmoussov Jun 18, 2024
fc15c48
refactor: faq to widgets
NikitaStarmoussov Jun 18, 2024
b3f0c9e
refactor: update names
NikitaStarmoussov Jun 18, 2024
df6b9be
refactor: about-home to widgets
NikitaStarmoussov Jun 18, 2024
4868abd
refactor: community to widgets
NikitaStarmoussov Jun 18, 2024
f926c06
refactor: contribute to widgets
NikitaStarmoussov Jun 18, 2024
e5d8f37
refactor: events to widgets, eventCard to entity
NikitaStarmoussov Jun 18, 2024
c3cee25
refactor: courseCard to entities
NikitaStarmoussov Jun 18, 2024
dabcca8
refactor: felete trash
NikitaStarmoussov Jun 18, 2024
ef6a77c
refactor: hero to widgets
NikitaStarmoussov Jun 18, 2024
d7dacda
refactor: update path
NikitaStarmoussov Jun 18, 2024
b33c8c9
refactor: merch to widgets
NikitaStarmoussov Jun 18, 2024
bb89d94
refactor: numbers to widgets
NikitaStarmoussov Jun 18, 2024
77233f0
refactor: pictures to widgets
NikitaStarmoussov Jun 18, 2024
32b002f
refactor: speakers to widgets
NikitaStarmoussov Jun 18, 2024
a3c0042
refactor: support to widgets
NikitaStarmoussov Jun 18, 2024
77c47c5
refactor: mentors-wanted to widgets
NikitaStarmoussov Jun 18, 2024
42bd6d1
refactor: Image to shared
NikitaStarmoussov Jun 18, 2024
b1f27d2
refactor: principle to widgets
NikitaStarmoussov Jun 18, 2024
4459ce2
refactor: required to widgets
NikitaStarmoussov Jun 18, 2024
2491706
refactor: features/school to widgets
NikitaStarmoussov Jun 18, 2024
0b49e2a
refactor: features to widgets
NikitaStarmoussov Jun 18, 2024
24b8a8c
refactor: delete app/comppnents
NikitaStarmoussov Jun 18, 2024
93239e4
Resolve conflicts
NikitaStarmoussov Jun 18, 2024
8f3133d
Merge pull request #318 from rolling-scopes/refactor/63-features-to-w…
NikitaStarmoussov Jun 18, 2024
24a5de5
refactor: delete row
NikitaStarmoussov Jun 18, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ dist-ssr
*.njsproj
*.sln
*.sw?
src/__tests__/visualTesting/results
src/__tests__/visualTesting/report
src/shared/__tests__/visualTesting/results
src/shared/__tests__/visualTesting/report
/blob-report/
/playwright/.cache/
2 changes: 1 addition & 1 deletion eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default [
'build/',
'coverage/',
'optimizeImages/',
'src/__tests__/',
'src/shared/__tests__/',
'vite.config.ts',
'vitest.config.ts',
'eslint.config.js',
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,4 @@
"vite": "^5.2.12",
"vitest": "^1.5.0"
}
}
}
6 changes: 3 additions & 3 deletions playwright.config.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import { defineConfig, devices } from '@playwright/test';

export default defineConfig({
testDir: 'src/__tests__/visualTesting',
testDir: 'src/shared/__tests__/visualTesting',
fullyParallel: true,
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 2 : 0,
workers: process.env.CI ? 1 : undefined,
reporter: process.env.CI
? 'dot'
: [['html', { outputFolder: 'src/__tests__/visualTesting/report' }]],
: [['html', { outputFolder: 'src/shared/__tests__/visualTesting/report' }]],
use: {
baseURL: 'http://localhost:5173',
trace: 'off',
},
outputDir: 'src/__tests__/visualTesting/results',
outputDir: 'src/shared/__tests__/visualTesting/results',
projects: [
{
name: 'Mobile Chrome',
Expand Down
8 changes: 4 additions & 4 deletions readme/end-to-end-testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ npx playwright test --ui

<img src="./assets/end-to-end-testing/UI.jpg" alt="image">

- if there are any problems whith screenshots comparison, go to `src/__tests__/visualTesting/results` and watch the results like this:
- if there are any problems whith screenshots comparison, go to `src/shared/__tests__/visualTesting/results` and watch the results like this:

<img src="./assets/end-to-end-testing/origin-diff.png" alt="image">

Expand All @@ -58,7 +58,7 @@ npx playwright test --ui
npx playwright test
```

- if there are any problems whith screenshots comparison, go to `src/__tests__/visualTesting/results` and watch the results.
- if there are any problems whith screenshots comparison, go to `src/shared/__tests__/visualTesting/results` and watch the results.

### πŸ”Update Screenshots

Expand All @@ -70,7 +70,7 @@ When intentional design changes cause test failures, to create new references us
npx playwright test --update-snapshots
```

- to update one or several screenshots only, please delete outdated reference images from the according folder (`src/__tests__/visualTesting/[NAME_OF_THE_TEST].spec.ts-snapshots`) and rerun tests again. On testing without samples, Playwright firstly will create them from your code.
- to update one or several screenshots only, please delete outdated reference images from the according folder (`src/shared/__tests__/visualTesting/[NAME_OF_THE_TEST].spec.ts-snapshots`) and rerun tests again. On testing without samples, Playwright firstly will create them from your code.

### πŸ‘€ Real-time Browsing via Specified Engine

Expand All @@ -96,7 +96,7 @@ If intentional changes affect the site's appearance, update the reference images

### πŸ— Screenshot Comparison Failed

When tests fail, review the error messages and comparison images in the `src/__tests__/visualTesting/results` folder to understand what went wrong. Common issues include layout shifts, missing elements, or unintended changes in styling.
When tests fail, review the error messages and comparison images in the `src/shared/__tests__/visualTesting/results` folder to understand what went wrong. Common issues include layout shifts, missing elements, or unintended changes in styling.

### ⏳Timeout Error

Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
1 change: 0 additions & 1 deletion src/app/components/breadcrumbs/index.ts

This file was deleted.

1 change: 0 additions & 1 deletion src/app/components/course-card/index.ts

This file was deleted.

1 change: 0 additions & 1 deletion src/app/components/event-card/index.ts

This file was deleted.

18 changes: 0 additions & 18 deletions src/app/components/index.ts

This file was deleted.

1 change: 0 additions & 1 deletion src/app/components/mobile-view/index.ts

This file was deleted.

1 change: 0 additions & 1 deletion src/app/components/option-item/index.ts

This file was deleted.

1 change: 0 additions & 1 deletion src/app/components/places/index.ts

This file was deleted.

1 change: 0 additions & 1 deletion src/app/components/principle-card/index.ts

This file was deleted.

1 change: 0 additions & 1 deletion src/app/components/school-menu/index.ts

This file was deleted.

6 changes: 0 additions & 6 deletions src/app/hooks/index.ts

This file was deleted.

2 changes: 0 additions & 2 deletions src/app/hooks/use-nearest-course/index.ts

This file was deleted.

134 changes: 0 additions & 134 deletions src/app/hooks/use-nearest-course/use-nearest-course.test.tsx

This file was deleted.

36 changes: 0 additions & 36 deletions src/app/hooks/use-nearest-course/use-nearest-course.ts

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Link } from 'react-router-dom';
import { LogoWrapper } from '@/app/components';
import { buildUrl } from '@/app/services/platform';
import { LogoWrapper } from '@/shared/ui/logo-wrapper';

const aboutList = [
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { AboutList } from './about-list';
import { SchoolMenu } from '@/app/components';
import { SchoolMenu } from '@/widgets/school-menu';

export const DesktopView = () => {
return (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import { type Mock, describe, expect, it } from 'vitest';
import { Footer } from './footer';
import { renderWithRouter } from '@/__tests__/utils';
import { useWindowSize } from '@/app/hooks';
import { renderWithRouter } from '@/shared/__tests__/utils';
import { useWindowSize } from '@/shared/hooks/use-window-size';

vi.mock('@/app/hooks', () => ({
useWindowSize: vi.fn().mockImplementation(() => ({ width: 1200 })),
useDataByName: vi.fn().mockImplementation(() => ({ data: [] })),
}));
vi.mock('@/shared/hooks/use-window-size', () => ({ useWindowSize: vi.fn().mockImplementation(() => ({ width: 1200 })) }));
vi.mock('@/shared/hooks/use-data-by-name', () => ({ useDataByName: vi.fn().mockImplementation(() => ({ data: [] })) }));

describe('Footer', () => {
it('should render without crashing', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { Copyright } from './copyright';
import { DesktopView } from './desktop-view';
import { MobileView } from '@/app/components';
import { useWindowSize } from '@/app/hooks';

import { useWindowSize } from '@/shared/hooks/use-window-size';
import { MobileView } from '@/widgets/mobile-view';

import './footer.scss';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { ReactNode } from 'react';
import classNames from 'classnames/bind';
import { usePositionDropdown } from '@/app/hooks';

import { usePositionDropdown } from '@/shared/hooks/use-position-dropdown';

import styles from './dropdown-wrapper.module.scss';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ import classNames from 'classnames/bind';
import { Mock, beforeEach, vi } from 'vitest';
import { DropdownWrapper } from './dropdown/dropdown-wrapper';
import { Header } from './header';
import { renderWithRouter } from '@/__tests__/utils';
import { useWindowSize } from '@/app/hooks';
import { renderWithRouter } from '@/shared/__tests__/utils';

import { useWindowSize } from '@/shared/hooks/use-window-size';

import stylesDropdown from './dropdown/dropdown-wrapper.module.scss';
import stylesHeader from './header.module.scss';
Expand All @@ -15,8 +16,8 @@ const cxDropdown = classNames.bind(stylesDropdown);
const cxHeader = classNames.bind(stylesHeader);
const cxNavItem = classNames.bind(stylesNavItem);

vi.mock('@/app/hooks', async (importOriginal) => {
const originalModule = await importOriginal<typeof import('@/app/hooks')>();
vi.mock('@/shared/hooks/use-window-size', async (importOriginal) => {
const originalModule = await importOriginal<typeof import('@/shared/hooks/use-window-size')>();

return {
...originalModule,
Expand Down Expand Up @@ -112,7 +113,7 @@ describe('Header', () => {
it('should be open when isDropdownOpen is true', async () => {
await act(async () =>
renderWithRouter(
<DropdownWrapper onMouseEnter={() => {}} onMouseLeave={() => {}} isOpen={true}>
<DropdownWrapper onMouseEnter={() => { }} onMouseLeave={() => { }} isOpen={true}>
TEST
</DropdownWrapper>,
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ import classNames from 'classnames/bind';
import { Link, useLocation } from 'react-router-dom';
import { BurgerMenu } from './burger/burger';
import { NavItem } from './nav-item/nav-item';
import { LogoWrapper, MobileView, SchoolMenu } from '@/app/components';
import { useWindowSize } from '@/app/hooks';
import { useWindowSize } from '@/shared/hooks/use-window-size';
import { LogoWrapper } from '@/shared/ui/logo-wrapper';
import { MobileView } from '@/widgets/mobile-view';
import { SchoolMenu } from '@/widgets/school-menu';

import styles from './header.module.scss';

Expand Down
Loading
Loading