0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2024-12-30 20:33:54 -05:00

fix(console): allow wrap for toast content (#3910)

This commit is contained in:
Xiao Yijun 2023-05-26 22:19:47 +08:00 committed by GitHub
parent 292e6ebc6f
commit 387e04ec4a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 10 deletions

View file

@ -21,6 +21,8 @@ div.toast {
.message {
flex: 1;
margin: 0 _.unit(3);
overflow: hidden;
overflow-wrap: break-word;
}
&.success {

View file

@ -24,9 +24,7 @@ function Toast() {
{(toastInstance) => (
<div className={toastInstance.className}>
<div className={styles.image}>{toastInstance.icon}</div>
<span className={styles.message}>
{resolveValue(toastInstance.message, toastInstance)}
</span>
<div className={styles.message}>{resolveValue(toastInstance.message, toastInstance)}</div>
</div>
)}
</Toaster>

View file

@ -104,7 +104,7 @@ describe('user management', () => {
await expect(page).toClick('div[class$=main] div[class$=headline] > button');
await expect(page).toFillForm('form', { primaryEmail: 'jdoe@gmail.com' });
await expect(page).toClick('button[type=submit]');
await expect(page).toMatchElement('div[class$=error] span[class$=message]', {
await expect(page).toMatchElement('div[class$=error] div[class$=message]', {
text: 'This email is associated with an existing account.',
});
await expect(page).toClick('.ReactModalPortal div[class$=header] button');
@ -113,7 +113,7 @@ describe('user management', () => {
await expect(page).toClick('div[class$=main] div[class$=headline] > button');
await expect(page).toFillForm('form', { primaryPhone: '+1 810 555 5555' });
await expect(page).toClick('button[type=submit]');
await expect(page).toMatchElement('div[class$=error] span[class$=message]', {
await expect(page).toMatchElement('div[class$=error] div[class$=message]', {
text: 'This phone number is associated with an existing account.',
});
await expect(page).toClick('.ReactModalPortal div[class$=header] button');
@ -122,7 +122,7 @@ describe('user management', () => {
await expect(page).toClick('div[class$=main] div[class$=headline] > button');
await expect(page).toFillForm('form', { username: 'johndoe' });
await expect(page).toClick('button[type=submit]');
await expect(page).toMatchElement('div[class$=error] span[class$=message]', {
await expect(page).toMatchElement('div[class$=error] div[class$=message]', {
text: 'This username is already in use.',
});
await expect(page).toClick('.ReactModalPortal div[class$=header] button');
@ -157,7 +157,7 @@ describe('user management', () => {
});
await expect(page).toClick('form div[class$=actionBar] button:nth-of-type(2)');
const successToastHandle = await page.waitForSelector('div[class$=success]');
await expect(successToastHandle).toMatchElement('span[class$=message]', {
await expect(successToastHandle).toMatchElement('div[class$=message]', {
text: 'Saved!',
});
// Top userinfo card shows the updated user full name as the title
@ -209,7 +209,7 @@ describe('user management', () => {
await expect(page).toFillForm('form', { primaryEmail: 'jdoe@gmail.com' });
await page.screenshot({ path: 'user-conflict-email.png' });
await expect(page).toClick('form div[class$=actionBar] button:nth-of-type(2)');
await expect(page).toMatchElement('div[class$=error] span[class$=message]', {
await expect(page).toMatchElement('div[class$=error] div[class$=message]', {
text: 'This email is associated with an existing account.',
});
// Discard changes
@ -218,7 +218,7 @@ describe('user management', () => {
// Conflicted phone number
await expect(page).toFillForm('form', { primaryPhone: '+1 810 555 5555' });
await expect(page).toClick('form div[class$=actionBar] button:nth-of-type(2)');
await expect(page).toMatchElement('div[class$=error] span[class$=message]', {
await expect(page).toMatchElement('div[class$=error] div[class$=message]', {
text: 'This phone number is associated with an existing account.',
});
// Discard changes
@ -227,7 +227,7 @@ describe('user management', () => {
// Conflicted username
await expect(page).toFillForm('form', { username: 'johndoe' });
await expect(page).toClick('form div[class$=actionBar] button:nth-of-type(2)');
await expect(page).toMatchElement('div[class$=error] span[class$=message]', {
await expect(page).toMatchElement('div[class$=error] div[class$=message]', {
text: 'This username is already in use.',
});
// Discard changes