mirror of
https://github.com/logto-io/logto.git
synced 2025-01-06 20:40:08 -05:00
fix(ui): update content
update content
This commit is contained in:
parent
f64a0f2df4
commit
f54e643d72
4 changed files with 15 additions and 15 deletions
|
@ -16,7 +16,7 @@ describe('<CreateAccount/>', () => {
|
||||||
expect(container.querySelector('input[name="new-username"]')).not.toBeNull();
|
expect(container.querySelector('input[name="new-username"]')).not.toBeNull();
|
||||||
expect(container.querySelector('input[name="new-password"]')).not.toBeNull();
|
expect(container.querySelector('input[name="new-password"]')).not.toBeNull();
|
||||||
expect(container.querySelector('input[name="confirm-new-password"]')).not.toBeNull();
|
expect(container.querySelector('input[name="confirm-new-password"]')).not.toBeNull();
|
||||||
expect(queryByText('action.create')).not.toBeNull();
|
expect(queryByText('action.create_account')).not.toBeNull();
|
||||||
});
|
});
|
||||||
|
|
||||||
test('render with terms settings enabled', () => {
|
test('render with terms settings enabled', () => {
|
||||||
|
@ -30,7 +30,7 @@ describe('<CreateAccount/>', () => {
|
||||||
|
|
||||||
test('username and password are required', () => {
|
test('username and password are required', () => {
|
||||||
const { queryByText, getByText } = renderWithPageContext(<CreateAccount />);
|
const { queryByText, getByText } = renderWithPageContext(<CreateAccount />);
|
||||||
const submitButton = getByText('action.create');
|
const submitButton = getByText('action.create_account');
|
||||||
fireEvent.click(submitButton);
|
fireEvent.click(submitButton);
|
||||||
|
|
||||||
expect(queryByText('username_required')).not.toBeNull();
|
expect(queryByText('username_required')).not.toBeNull();
|
||||||
|
@ -41,7 +41,7 @@ describe('<CreateAccount/>', () => {
|
||||||
|
|
||||||
test('username with initial numeric char should throw', () => {
|
test('username with initial numeric char should throw', () => {
|
||||||
const { queryByText, getByText, container } = renderWithPageContext(<CreateAccount />);
|
const { queryByText, getByText, container } = renderWithPageContext(<CreateAccount />);
|
||||||
const submitButton = getByText('action.create');
|
const submitButton = getByText('action.create_account');
|
||||||
|
|
||||||
const usernameInput = container.querySelector('input[name="new-username"]');
|
const usernameInput = container.querySelector('input[name="new-username"]');
|
||||||
|
|
||||||
|
@ -65,7 +65,7 @@ describe('<CreateAccount/>', () => {
|
||||||
|
|
||||||
test('username with special character should throw', () => {
|
test('username with special character should throw', () => {
|
||||||
const { queryByText, getByText, container } = renderWithPageContext(<CreateAccount />);
|
const { queryByText, getByText, container } = renderWithPageContext(<CreateAccount />);
|
||||||
const submitButton = getByText('action.create');
|
const submitButton = getByText('action.create_account');
|
||||||
const usernameInput = container.querySelector('input[name="new-username"]');
|
const usernameInput = container.querySelector('input[name="new-username"]');
|
||||||
|
|
||||||
if (usernameInput) {
|
if (usernameInput) {
|
||||||
|
@ -88,7 +88,7 @@ describe('<CreateAccount/>', () => {
|
||||||
|
|
||||||
test('password less than 6 chars should throw', () => {
|
test('password less than 6 chars should throw', () => {
|
||||||
const { queryByText, getByText, container } = renderWithPageContext(<CreateAccount />);
|
const { queryByText, getByText, container } = renderWithPageContext(<CreateAccount />);
|
||||||
const submitButton = getByText('action.create');
|
const submitButton = getByText('action.create_account');
|
||||||
const passwordInput = container.querySelector('input[name="new-password"]');
|
const passwordInput = container.querySelector('input[name="new-password"]');
|
||||||
|
|
||||||
if (passwordInput) {
|
if (passwordInput) {
|
||||||
|
@ -111,7 +111,7 @@ describe('<CreateAccount/>', () => {
|
||||||
|
|
||||||
test('password mismatch with confirmPassword should throw', () => {
|
test('password mismatch with confirmPassword should throw', () => {
|
||||||
const { queryByText, getByText, container } = renderWithPageContext(<CreateAccount />);
|
const { queryByText, getByText, container } = renderWithPageContext(<CreateAccount />);
|
||||||
const submitButton = getByText('action.create');
|
const submitButton = getByText('action.create_account');
|
||||||
const passwordInput = container.querySelector('input[name="new-password"]');
|
const passwordInput = container.querySelector('input[name="new-password"]');
|
||||||
const confirmPasswordInput = container.querySelector('input[name="confirm-new-password"]');
|
const confirmPasswordInput = container.querySelector('input[name="confirm-new-password"]');
|
||||||
const usernameInput = container.querySelector('input[name="username"]');
|
const usernameInput = container.querySelector('input[name="username"]');
|
||||||
|
@ -148,7 +148,7 @@ describe('<CreateAccount/>', () => {
|
||||||
const passwordInput = container.querySelector('input[name="new-password"]');
|
const passwordInput = container.querySelector('input[name="new-password"]');
|
||||||
const confirmPasswordInput = container.querySelector('input[name="confirm-new-password"]');
|
const confirmPasswordInput = container.querySelector('input[name="confirm-new-password"]');
|
||||||
const usernameInput = container.querySelector('input[name="new-username"]');
|
const usernameInput = container.querySelector('input[name="new-username"]');
|
||||||
const submitButton = getByText('action.create');
|
const submitButton = getByText('action.create_account');
|
||||||
|
|
||||||
if (usernameInput) {
|
if (usernameInput) {
|
||||||
fireEvent.change(usernameInput, { target: { value: 'username' } });
|
fireEvent.change(usernameInput, { target: { value: 'username' } });
|
||||||
|
@ -198,7 +198,7 @@ describe('<CreateAccount/>', () => {
|
||||||
<CreateAccount />
|
<CreateAccount />
|
||||||
</SettingsProvider>
|
</SettingsProvider>
|
||||||
);
|
);
|
||||||
const submitButton = getByText('action.create');
|
const submitButton = getByText('action.create_account');
|
||||||
const passwordInput = container.querySelector('input[name="new-password"]');
|
const passwordInput = container.querySelector('input[name="new-password"]');
|
||||||
const confirmPasswordInput = container.querySelector('input[name="confirm-new-password"]');
|
const confirmPasswordInput = container.querySelector('input[name="confirm-new-password"]');
|
||||||
const usernameInput = container.querySelector('input[name="new-username"]');
|
const usernameInput = container.querySelector('input[name="new-username"]');
|
||||||
|
|
|
@ -124,7 +124,7 @@ const CreateAccount = ({ className, autoFocus }: Props) => {
|
||||||
|
|
||||||
<TermsOfUse className={styles.terms} />
|
<TermsOfUse className={styles.terms} />
|
||||||
|
|
||||||
<Button title="action.create" onClick={async () => onSubmitHandler()} />
|
<Button title="action.create_account" onClick={async () => onSubmitHandler()} />
|
||||||
|
|
||||||
<input hidden type="submit" />
|
<input hidden type="submit" />
|
||||||
</form>
|
</form>
|
||||||
|
|
|
@ -21,7 +21,7 @@ describe('<UsernameRegister />', () => {
|
||||||
test('default render', () => {
|
test('default render', () => {
|
||||||
const { queryByText, container } = renderWithPageContext(<UsernameRegister />);
|
const { queryByText, container } = renderWithPageContext(<UsernameRegister />);
|
||||||
expect(container.querySelector('input[name="new-username"]')).not.toBeNull();
|
expect(container.querySelector('input[name="new-username"]')).not.toBeNull();
|
||||||
expect(queryByText('action.create')).not.toBeNull();
|
expect(queryByText('action.create_account')).not.toBeNull();
|
||||||
});
|
});
|
||||||
|
|
||||||
test('render with terms settings enabled', () => {
|
test('render with terms settings enabled', () => {
|
||||||
|
@ -35,7 +35,7 @@ describe('<UsernameRegister />', () => {
|
||||||
|
|
||||||
test('username are required', () => {
|
test('username are required', () => {
|
||||||
const { queryByText, getByText } = renderWithPageContext(<UsernameRegister />);
|
const { queryByText, getByText } = renderWithPageContext(<UsernameRegister />);
|
||||||
const submitButton = getByText('action.create');
|
const submitButton = getByText('action.create_account');
|
||||||
fireEvent.click(submitButton);
|
fireEvent.click(submitButton);
|
||||||
|
|
||||||
expect(queryByText('username_required')).not.toBeNull();
|
expect(queryByText('username_required')).not.toBeNull();
|
||||||
|
@ -45,7 +45,7 @@ describe('<UsernameRegister />', () => {
|
||||||
|
|
||||||
test('username with initial numeric char should throw', () => {
|
test('username with initial numeric char should throw', () => {
|
||||||
const { queryByText, getByText, container } = renderWithPageContext(<UsernameRegister />);
|
const { queryByText, getByText, container } = renderWithPageContext(<UsernameRegister />);
|
||||||
const submitButton = getByText('action.create');
|
const submitButton = getByText('action.create_account');
|
||||||
|
|
||||||
const usernameInput = container.querySelector('input[name="new-username"]');
|
const usernameInput = container.querySelector('input[name="new-username"]');
|
||||||
|
|
||||||
|
@ -69,7 +69,7 @@ describe('<UsernameRegister />', () => {
|
||||||
|
|
||||||
test('username with special character should throw', () => {
|
test('username with special character should throw', () => {
|
||||||
const { queryByText, getByText, container } = renderWithPageContext(<UsernameRegister />);
|
const { queryByText, getByText, container } = renderWithPageContext(<UsernameRegister />);
|
||||||
const submitButton = getByText('action.create');
|
const submitButton = getByText('action.create_account');
|
||||||
const usernameInput = container.querySelector('input[name="new-username"]');
|
const usernameInput = container.querySelector('input[name="new-username"]');
|
||||||
|
|
||||||
if (usernameInput) {
|
if (usernameInput) {
|
||||||
|
@ -96,7 +96,7 @@ describe('<UsernameRegister />', () => {
|
||||||
<UsernameRegister />
|
<UsernameRegister />
|
||||||
</SettingsProvider>
|
</SettingsProvider>
|
||||||
);
|
);
|
||||||
const submitButton = getByText('action.create');
|
const submitButton = getByText('action.create_account');
|
||||||
const usernameInput = container.querySelector('input[name="new-username"]');
|
const usernameInput = container.querySelector('input[name="new-username"]');
|
||||||
|
|
||||||
if (usernameInput) {
|
if (usernameInput) {
|
||||||
|
|
|
@ -96,7 +96,7 @@ const UsernameRegister = ({ className }: Props) => {
|
||||||
|
|
||||||
<TermsOfUse className={styles.terms} />
|
<TermsOfUse className={styles.terms} />
|
||||||
|
|
||||||
<Button title="action.create" onClick={async () => onSubmitHandler()} />
|
<Button title="action.create_account" onClick={async () => onSubmitHandler()} />
|
||||||
|
|
||||||
<input hidden type="submit" />
|
<input hidden type="submit" />
|
||||||
</form>
|
</form>
|
||||||
|
|
Loading…
Reference in a new issue