diff --git a/packages/ui/src/test/App.test.tsx b/packages/ui/src/App.test.tsx similarity index 93% rename from packages/ui/src/test/App.test.tsx rename to packages/ui/src/App.test.tsx index b83b13670..ac5a77e5b 100644 --- a/packages/ui/src/test/App.test.tsx +++ b/packages/ui/src/App.test.tsx @@ -1,7 +1,7 @@ import React from 'react'; import ReactDOM from 'react-dom'; import { MemoryRouter } from 'react-router-dom'; -import App from '../App'; +import App from './App'; jest.mock('ky', () => ({})); diff --git a/packages/ui/src/App.tsx b/packages/ui/src/App.tsx index b1faa55fb..75f7a9f1d 100644 --- a/packages/ui/src/App.tsx +++ b/packages/ui/src/App.tsx @@ -10,7 +10,7 @@ import './scss/normalized.scss'; initI18n(); const App = () => ( - + diff --git a/packages/ui/src/test/pages/Register.test.tsx b/packages/ui/src/pages/Register/Register.test.tsx similarity index 82% rename from packages/ui/src/test/pages/Register.test.tsx rename to packages/ui/src/pages/Register/Register.test.tsx index ab376f07c..e0a6b9f49 100644 --- a/packages/ui/src/test/pages/Register.test.tsx +++ b/packages/ui/src/pages/Register/Register.test.tsx @@ -1,13 +1,13 @@ import React from 'react'; import { render, fireEvent, waitFor } from '@testing-library/react'; -import App from '@/pages/Register'; +import Register from '@/pages/Register'; import { register } from '@/apis/register'; jest.mock('@/apis/register', () => ({ register: jest.fn(async () => Promise.resolve()) })); -describe('', () => { +describe('', () => { test('renders without exploding', async () => { - const { queryByText, getByText } = render(); + const { queryByText, getByText } = render(); expect(queryByText('register.create_account')).not.toBeNull(); expect(queryByText('register.have_account')).not.toBeNull(); diff --git a/packages/ui/src/pages/Register/index.module.scss b/packages/ui/src/pages/Register/index.module.scss index 7b87770db..945720075 100644 --- a/packages/ui/src/pages/Register/index.module.scss +++ b/packages/ui/src/pages/Register/index.module.scss @@ -1,23 +1,16 @@ @use '/src/scss/underscore' as _; -@mixin flex-colomn { - display: flex; - flex-direction: column; - align-items: center; - justify-content: center; -} - .wrapper { position: relative; padding: _.unit(8); height: 100%; - @include flex-colomn; + @include _.flex-colomn; } .form { width: 100%; - @include flex-colomn; + @include _.flex-colomn; > * { margin-bottom: _.unit(1.5); diff --git a/packages/ui/src/test/pages/SignIn.test.tsx b/packages/ui/src/pages/SignIn/SignIn.test.tsx similarity index 81% rename from packages/ui/src/test/pages/SignIn.test.tsx rename to packages/ui/src/pages/SignIn/SignIn.test.tsx index daecf5de2..490a8f4d3 100644 --- a/packages/ui/src/test/pages/SignIn.test.tsx +++ b/packages/ui/src/pages/SignIn/SignIn.test.tsx @@ -1,13 +1,13 @@ import React from 'react'; import { render, fireEvent, waitFor } from '@testing-library/react'; -import App from '@/pages/SignIn'; +import SignIn from '@/pages/SignIn'; import { signInBasic } from '@/apis/sign-in'; jest.mock('@/apis/sign-in', () => ({ signInBasic: jest.fn(async () => Promise.resolve()) })); -describe('', () => { +describe('', () => { test('renders without exploding', async () => { - const { queryByText, getByText } = render(); + const { queryByText, getByText } = render(); expect(queryByText('Sign in to Logto')).not.toBeNull(); const submit = getByText('sign_in.title'); diff --git a/packages/ui/src/scss/_underscore.scss b/packages/ui/src/scss/_underscore.scss index f023a6369..cec14dfb4 100644 --- a/packages/ui/src/scss/_underscore.scss +++ b/packages/ui/src/scss/_underscore.scss @@ -1,3 +1,10 @@ @function unit($factor: 1, $unit: 'px') { @return #{$factor * 4}#{$unit}; } + +@mixin flex-colomn { + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; +} \ No newline at end of file