Skip to content

Commit

Permalink
fix: Horizontal scroll in main room if text is too long (#28434)
Browse files Browse the repository at this point in the history
Co-authored-by: Hugo Costa <hugocarreiracosta@gmail.com>
  • Loading branch information
gabriellsh and hugocostadev authored Mar 20, 2023
1 parent 94bdfa0 commit f57f42f
Show file tree
Hide file tree
Showing 9 changed files with 187 additions and 185 deletions.
8 changes: 4 additions & 4 deletions apps/meteor/tests/e2e/e2e-encryption.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ test.describe.serial('e2e-encryption', () => {

await poHomeChannel.content.sendMessage('hello world');

await expect(poHomeChannel.content.lastUserMessage.locator('p')).toHaveText('hello world');
await expect(poHomeChannel.content.lastUserMessageBody).toHaveText('hello world');
await expect(poHomeChannel.content.lastUserMessage.locator('.rcx-icon--name-key')).toBeVisible();

await poHomeChannel.tabs.kebab.click({ force: true });
Expand All @@ -171,7 +171,7 @@ test.describe.serial('e2e-encryption', () => {

await poHomeChannel.content.sendMessage('hello world not encrypted');

await expect(poHomeChannel.content.lastUserMessage.locator('p')).toHaveText('hello world not encrypted');
await expect(poHomeChannel.content.lastUserMessageBody).toHaveText('hello world not encrypted');
await expect(poHomeChannel.content.lastUserMessage.locator('.rcx-icon--name-key')).not.toBeVisible();

await poHomeChannel.tabs.kebab.click({ force: true });
Expand All @@ -181,7 +181,7 @@ test.describe.serial('e2e-encryption', () => {

await poHomeChannel.content.sendMessage('hello world encrypted again');

await expect(poHomeChannel.content.lastUserMessage.locator('p')).toHaveText('hello world encrypted again');
await expect(poHomeChannel.content.lastUserMessageBody).toHaveText('hello world encrypted again');
await expect(poHomeChannel.content.lastUserMessage.locator('.rcx-icon--name-key')).toBeVisible();
});

Expand All @@ -207,7 +207,7 @@ test.describe.serial('e2e-encryption', () => {

await poHomeChannel.content.sendMessage('hello world');

await expect(poHomeChannel.content.lastUserMessage.locator('p')).toHaveText('hello world');
await expect(poHomeChannel.content.lastUserMessageBody).toHaveText('hello world');
await expect(poHomeChannel.content.lastUserMessage.locator('.rcx-icon--name-key')).toBeVisible();
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ export class FederationHomeContent {
return this.page.locator('[data-qa-type="message"]').last();
}

get lastUserMessageBody(): Locator {
return this.lastUserMessage.locator('[data-qa-type="message-body"]');
}

get lastUserMessageNotSequential(): Locator {
return this.page.locator('[data-qa-type="message"][data-sequential="false"]').last();
}
Expand Down
102 changes: 51 additions & 51 deletions apps/meteor/tests/e2e/federation/tests/messaging/dm.spec.ts

Large diffs are not rendered by default.

112 changes: 56 additions & 56 deletions apps/meteor/tests/e2e/federation/tests/messaging/private.spec.ts

Large diffs are not rendered by default.

112 changes: 56 additions & 56 deletions apps/meteor/tests/e2e/federation/tests/messaging/public.spec.ts

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions apps/meteor/tests/e2e/messaging.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ test.describe.serial('Messaging', () => {

await poHomeChannel.content.sendMessage('hello world');

await expect(auxContext.poHomeChannel.content.lastUserMessage.locator('p')).toHaveText('hello world');
await expect(poHomeChannel.content.lastUserMessage.locator('p')).toHaveText('hello world');
await expect(auxContext.poHomeChannel.content.lastUserMessageBody).toHaveText('hello world');
await expect(poHomeChannel.content.lastUserMessageBody).toHaveText('hello world');

await auxContext.page.close();
});
Expand All @@ -43,8 +43,8 @@ test.describe.serial('Messaging', () => {

await poHomeChannel.content.sendMessage('hello world');

await expect(poHomeChannel.content.lastUserMessage.locator('p')).toHaveText('hello world');
await expect(auxContext.poHomeChannel.content.lastUserMessage.locator('p')).toHaveText('hello world');
await expect(poHomeChannel.content.lastUserMessageBody).toHaveText('hello world');
await expect(auxContext.poHomeChannel.content.lastUserMessageBody).toHaveText('hello world');

await auxContext.page.close();
});
Expand Down
4 changes: 4 additions & 0 deletions apps/meteor/tests/e2e/page-objects/fragments/home-content.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ export class HomeContent {
return this.page.locator('[data-qa-type="message"]').last();
}

get lastUserMessageBody(): Locator {
return this.lastUserMessage.locator('[data-qa-type="message-body"]');
}

get lastUserMessageNotSequential(): Locator {
return this.page.locator('[data-qa-type="message"][data-sequential="false"]').last();
}
Expand Down
13 changes: 5 additions & 8 deletions packages/gazzodown/src/blocks/HeadingBlock.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,11 @@ const HeadingBlock = ({ children = [], level = 1 }: HeadingBlockProps): ReactEle
const HeadingTag = `h${level}` as const;

return (
<>
<HeadingTag style={{ display: 'inline-block' }}>
{children.map((block, index) => (
<PlainSpan key={index} text={block.value} />
))}
</HeadingTag>
<br />
</>
<HeadingTag>
{children.map((block, index) => (
<PlainSpan key={index} text={block.value} />
))}
</HeadingTag>
);
};

Expand Down
9 changes: 3 additions & 6 deletions packages/gazzodown/src/blocks/ParagraphBlock.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,9 @@ type ParagraphBlockProps = {
};

const ParagraphBlock = ({ children }: ParagraphBlockProps): ReactElement => (
<>
<p style={{ display: 'inline-block' }}>
<InlineElements children={children} />
</p>
<br />
</>
<div>
<InlineElements children={children} />
</div>
);

export default ParagraphBlock;

0 comments on commit f57f42f

Please sign in to comment.