mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-07-04 15:16:49 -07:00
refactor(cli): integrate real config loading into async test utils (#23040)
This commit is contained in:
committed by
GitHub
parent
7de0616229
commit
23264ced9a
@@ -21,7 +21,7 @@ describe('<MarkdownDisplay />', () => {
|
||||
});
|
||||
|
||||
it('renders nothing for empty text', async () => {
|
||||
const { lastFrame, waitUntilReady, unmount } = renderWithProviders(
|
||||
const { lastFrame, waitUntilReady, unmount } = await renderWithProviders(
|
||||
<MarkdownDisplay {...baseProps} text="" />,
|
||||
);
|
||||
await waitUntilReady();
|
||||
@@ -31,7 +31,7 @@ describe('<MarkdownDisplay />', () => {
|
||||
|
||||
it('renders a simple paragraph', async () => {
|
||||
const text = 'Hello, world.';
|
||||
const { lastFrame, waitUntilReady, unmount } = renderWithProviders(
|
||||
const { lastFrame, waitUntilReady, unmount } = await renderWithProviders(
|
||||
<MarkdownDisplay {...baseProps} text={text} />,
|
||||
);
|
||||
await waitUntilReady();
|
||||
@@ -52,7 +52,7 @@ describe('<MarkdownDisplay />', () => {
|
||||
### Header 3
|
||||
#### Header 4
|
||||
`.replace(/\n/g, eol);
|
||||
const { lastFrame, waitUntilReady, unmount } = renderWithProviders(
|
||||
const { lastFrame, waitUntilReady, unmount } = await renderWithProviders(
|
||||
<MarkdownDisplay {...baseProps} text={text} />,
|
||||
);
|
||||
await waitUntilReady();
|
||||
@@ -65,7 +65,7 @@ describe('<MarkdownDisplay />', () => {
|
||||
/\n/g,
|
||||
eol,
|
||||
);
|
||||
const { lastFrame, waitUntilReady, unmount } = renderWithProviders(
|
||||
const { lastFrame, waitUntilReady, unmount } = await renderWithProviders(
|
||||
<MarkdownDisplay {...baseProps} text={text} />,
|
||||
);
|
||||
await waitUntilReady();
|
||||
@@ -75,7 +75,7 @@ describe('<MarkdownDisplay />', () => {
|
||||
|
||||
it('renders a fenced code block without a language', async () => {
|
||||
const text = '```\nplain text\n```'.replace(/\n/g, eol);
|
||||
const { lastFrame, waitUntilReady, unmount } = renderWithProviders(
|
||||
const { lastFrame, waitUntilReady, unmount } = await renderWithProviders(
|
||||
<MarkdownDisplay {...baseProps} text={text} />,
|
||||
);
|
||||
await waitUntilReady();
|
||||
@@ -85,7 +85,7 @@ describe('<MarkdownDisplay />', () => {
|
||||
|
||||
it('handles unclosed (pending) code blocks', async () => {
|
||||
const text = '```typescript\nlet y = 2;'.replace(/\n/g, eol);
|
||||
const { lastFrame, waitUntilReady, unmount } = renderWithProviders(
|
||||
const { lastFrame, waitUntilReady, unmount } = await renderWithProviders(
|
||||
<MarkdownDisplay {...baseProps} text={text} isPending={true} />,
|
||||
);
|
||||
await waitUntilReady();
|
||||
@@ -99,7 +99,7 @@ describe('<MarkdownDisplay />', () => {
|
||||
* item B
|
||||
+ item C
|
||||
`.replace(/\n/g, eol);
|
||||
const { lastFrame, waitUntilReady, unmount } = renderWithProviders(
|
||||
const { lastFrame, waitUntilReady, unmount } = await renderWithProviders(
|
||||
<MarkdownDisplay {...baseProps} text={text} />,
|
||||
);
|
||||
await waitUntilReady();
|
||||
@@ -113,7 +113,7 @@ describe('<MarkdownDisplay />', () => {
|
||||
* Level 2
|
||||
* Level 3
|
||||
`.replace(/\n/g, eol);
|
||||
const { lastFrame, waitUntilReady, unmount } = renderWithProviders(
|
||||
const { lastFrame, waitUntilReady, unmount } = await renderWithProviders(
|
||||
<MarkdownDisplay {...baseProps} text={text} />,
|
||||
);
|
||||
await waitUntilReady();
|
||||
@@ -126,7 +126,7 @@ describe('<MarkdownDisplay />', () => {
|
||||
1. First item
|
||||
2. Second item
|
||||
`.replace(/\n/g, eol);
|
||||
const { lastFrame, waitUntilReady, unmount } = renderWithProviders(
|
||||
const { lastFrame, waitUntilReady, unmount } = await renderWithProviders(
|
||||
<MarkdownDisplay {...baseProps} text={text} />,
|
||||
);
|
||||
await waitUntilReady();
|
||||
@@ -142,7 +142,7 @@ World
|
||||
***
|
||||
Test
|
||||
`.replace(/\n/g, eol);
|
||||
const { lastFrame, waitUntilReady, unmount } = renderWithProviders(
|
||||
const { lastFrame, waitUntilReady, unmount } = await renderWithProviders(
|
||||
<MarkdownDisplay {...baseProps} text={text} />,
|
||||
);
|
||||
await waitUntilReady();
|
||||
@@ -157,7 +157,7 @@ Test
|
||||
| Cell 1 | Cell 2 |
|
||||
| Cell 3 | Cell 4 |
|
||||
`.replace(/\n/g, eol);
|
||||
const { lastFrame, waitUntilReady, unmount } = renderWithProviders(
|
||||
const { lastFrame, waitUntilReady, unmount } = await renderWithProviders(
|
||||
<MarkdownDisplay {...baseProps} text={text} />,
|
||||
);
|
||||
await waitUntilReady();
|
||||
@@ -171,7 +171,7 @@ Some text before.
|
||||
| A | B |
|
||||
|---|
|
||||
| 1 | 2 |`.replace(/\n/g, eol);
|
||||
const { lastFrame, waitUntilReady, unmount } = renderWithProviders(
|
||||
const { lastFrame, waitUntilReady, unmount } = await renderWithProviders(
|
||||
<MarkdownDisplay {...baseProps} text={text} />,
|
||||
);
|
||||
await waitUntilReady();
|
||||
@@ -183,7 +183,7 @@ Some text before.
|
||||
const text = `Paragraph 1.
|
||||
|
||||
Paragraph 2.`.replace(/\n/g, eol);
|
||||
const { lastFrame, waitUntilReady, unmount } = renderWithProviders(
|
||||
const { lastFrame, waitUntilReady, unmount } = await renderWithProviders(
|
||||
<MarkdownDisplay {...baseProps} text={text} />,
|
||||
);
|
||||
await waitUntilReady();
|
||||
@@ -206,7 +206,7 @@ some code
|
||||
|
||||
Another paragraph.
|
||||
`.replace(/\n/g, eol);
|
||||
const { lastFrame, waitUntilReady, unmount } = renderWithProviders(
|
||||
const { lastFrame, waitUntilReady, unmount } = await renderWithProviders(
|
||||
<MarkdownDisplay {...baseProps} text={text} />,
|
||||
);
|
||||
await waitUntilReady();
|
||||
@@ -229,7 +229,7 @@ Another paragraph.
|
||||
[],
|
||||
);
|
||||
|
||||
const { lastFrame, waitUntilReady, unmount } = renderWithProviders(
|
||||
const { lastFrame, waitUntilReady, unmount } = await renderWithProviders(
|
||||
<MarkdownDisplay {...baseProps} text={text} />,
|
||||
{ settings },
|
||||
);
|
||||
@@ -241,7 +241,7 @@ Another paragraph.
|
||||
|
||||
it('shows line numbers in code blocks by default', async () => {
|
||||
const text = '```javascript\nconst x = 1;\n```'.replace(/\n/g, eol);
|
||||
const { lastFrame, waitUntilReady, unmount } = renderWithProviders(
|
||||
const { lastFrame, waitUntilReady, unmount } = await renderWithProviders(
|
||||
<MarkdownDisplay {...baseProps} text={text} />,
|
||||
);
|
||||
await waitUntilReady();
|
||||
|
||||
Reference in New Issue
Block a user