Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@
"node-pty": "^1.1.0",
"prettier": "^3.7.4",
"secretlint": "^12.2.0",
"strip-ansi": "^7.2.0",
"tsx": "^4.21.0",
"typescript": "^5",
"typescript-eslint": "^8.50.1",
Expand Down
5 changes: 3 additions & 2 deletions src/cli/tui/components/__tests__/DeployStatus.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import type { DeployMessage } from '../../../cdk/toolkit-lib/index.js';
import { DeployStatus } from '../DeployStatus.js';
import { render } from 'ink-testing-library';
import React from 'react';
import stripAnsi from 'strip-ansi';
import { describe, expect, it } from 'vitest';

function makeMsg(
Expand All @@ -28,7 +29,7 @@ describe('DeployStatus', () => {
it('shows "Deploying to AWS" when not complete', () => {
const { lastFrame } = render(<DeployStatus messages={[]} isComplete={false} hasError={false} />);

expect(lastFrame()).toContain('Deploying to AWS');
expect(stripAnsi(lastFrame()!)).toContain('Deploying to AWS');
});

it('shows success message when complete without error', () => {
Expand Down Expand Up @@ -90,7 +91,7 @@ describe('DeployStatus', () => {
const { lastFrame } = render(<DeployStatus messages={messages} isComplete={false} hasError={false} />);

// Should show deploying text but no resource lines
expect(lastFrame()).toContain('Deploying to AWS');
expect(stripAnsi(lastFrame()!)).toContain('Deploying to AWS');
expect(lastFrame()).not.toContain('Some general info');
});

Expand Down
3 changes: 2 additions & 1 deletion src/cli/tui/components/__tests__/LogPanel.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import type { LogEntry } from '../LogPanel.js';
import { LogPanel } from '../LogPanel.js';
import { render } from 'ink-testing-library';
import React from 'react';
import stripAnsi from 'strip-ansi';
import { afterEach, describe, expect, it, vi } from 'vitest';

const UP_ARROW = '\x1B[A';
Expand All @@ -19,7 +20,7 @@ describe('LogPanel', () => {
describe('empty state', () => {
it('renders "No output yet" with no other content', () => {
const { lastFrame } = render(<LogPanel logs={[]} />);
expect(lastFrame()).toBe('No output yet');
expect(stripAnsi(lastFrame()!)).toBe('No output yet');
});
});

Expand Down
3 changes: 2 additions & 1 deletion src/cli/tui/components/__tests__/SecretInput.test.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { ApiKeySecretInput, SecretInput } from '../SecretInput.js';
import { render } from 'ink-testing-library';
import React from 'react';
import stripAnsi from 'strip-ansi';
import { afterEach, describe, expect, it, vi } from 'vitest';
import { z } from 'zod';

Expand Down Expand Up @@ -34,7 +35,7 @@ describe('SecretInput', () => {
<SecretInput prompt="Key" placeholder="sk-..." onSubmit={vi.fn()} onCancel={vi.fn()} />
);

expect(lastFrame()).toContain('sk-...');
expect(stripAnsi(lastFrame()!)).toContain('sk-...');
});

it('masks input with default * character', async () => {
Expand Down
Loading