0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2024-12-16 20:26:19 -05:00

fix(ui): update content

update content
This commit is contained in:
simeng-li 2022-11-10 10:07:37 +08:00
parent f64a0f2df4
commit f54e643d72
No known key found for this signature in database
GPG key ID: 14EA7BB1541E8075
4 changed files with 15 additions and 15 deletions

View file

@ -16,7 +16,7 @@ describe('<CreateAccount/>', () => {
expect(container.querySelector('input[name="new-username"]')).not.toBeNull();
expect(container.querySelector('input[name="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', () => {
@ -30,7 +30,7 @@ describe('<CreateAccount/>', () => {
test('username and password are required', () => {
const { queryByText, getByText } = renderWithPageContext(<CreateAccount />);
const submitButton = getByText('action.create');
const submitButton = getByText('action.create_account');
fireEvent.click(submitButton);
expect(queryByText('username_required')).not.toBeNull();
@ -41,7 +41,7 @@ describe('<CreateAccount/>', () => {
test('username with initial numeric char should throw', () => {
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"]');
@ -65,7 +65,7 @@ describe('<CreateAccount/>', () => {
test('username with special character should throw', () => {
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"]');
if (usernameInput) {
@ -88,7 +88,7 @@ describe('<CreateAccount/>', () => {
test('password less than 6 chars should throw', () => {
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"]');
if (passwordInput) {
@ -111,7 +111,7 @@ describe('<CreateAccount/>', () => {
test('password mismatch with confirmPassword should throw', () => {
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 confirmPasswordInput = container.querySelector('input[name="confirm-new-password"]');
const usernameInput = container.querySelector('input[name="username"]');
@ -148,7 +148,7 @@ describe('<CreateAccount/>', () => {
const passwordInput = container.querySelector('input[name="new-password"]');
const confirmPasswordInput = container.querySelector('input[name="confirm-new-password"]');
const usernameInput = container.querySelector('input[name="new-username"]');
const submitButton = getByText('action.create');
const submitButton = getByText('action.create_account');
if (usernameInput) {
fireEvent.change(usernameInput, { target: { value: 'username' } });
@ -198,7 +198,7 @@ describe('<CreateAccount/>', () => {
<CreateAccount />
</SettingsProvider>
);
const submitButton = getByText('action.create');
const submitButton = getByText('action.create_account');
const passwordInput = container.querySelector('input[name="new-password"]');
const confirmPasswordInput = container.querySelector('input[name="confirm-new-password"]');
const usernameInput = container.querySelector('input[name="new-username"]');

View file

@ -124,7 +124,7 @@ const CreateAccount = ({ className, autoFocus }: Props) => {
<TermsOfUse className={styles.terms} />
<Button title="action.create" onClick={async () => onSubmitHandler()} />
<Button title="action.create_account" onClick={async () => onSubmitHandler()} />
<input hidden type="submit" />
</form>

View file

@ -21,7 +21,7 @@ describe('<UsernameRegister />', () => {
test('default render', () => {
const { queryByText, container } = renderWithPageContext(<UsernameRegister />);
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', () => {
@ -35,7 +35,7 @@ describe('<UsernameRegister />', () => {
test('username are required', () => {
const { queryByText, getByText } = renderWithPageContext(<UsernameRegister />);
const submitButton = getByText('action.create');
const submitButton = getByText('action.create_account');
fireEvent.click(submitButton);
expect(queryByText('username_required')).not.toBeNull();
@ -45,7 +45,7 @@ describe('<UsernameRegister />', () => {
test('username with initial numeric char should throw', () => {
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"]');
@ -69,7 +69,7 @@ describe('<UsernameRegister />', () => {
test('username with special character should throw', () => {
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"]');
if (usernameInput) {
@ -96,7 +96,7 @@ describe('<UsernameRegister />', () => {
<UsernameRegister />
</SettingsProvider>
);
const submitButton = getByText('action.create');
const submitButton = getByText('action.create_account');
const usernameInput = container.querySelector('input[name="new-username"]');
if (usernameInput) {

View file

@ -96,7 +96,7 @@ const UsernameRegister = ({ className }: Props) => {
<TermsOfUse className={styles.terms} />
<Button title="action.create" onClick={async () => onSubmitHandler()} />
<Button title="action.create_account" onClick={async () => onSubmitHandler()} />
<input hidden type="submit" />
</form>