stack action buttons show for stopped and freshly created stacks, regression

This commit is contained in:
Jarek Krochmalski committed 2026-09-14 05:25:04 +02:00
1 parent ee6da80e81
commit 2d9e5e12d6
3 files changed
+40 -1

No files matched your search

+27
View File
@@ -0,0 +1,27 @@
import { describe, test, expect } from 'bun:test';
import { showsManagementActions } from '../src/lib/utils/stack-actions';
describe('showsManagementActions', () => {
test('non-git stopped/created stacks show actions (the Start button regression)', () => {
expect(showsManagementActions('internal', 'created')).toBe(true);
expect(showsManagementActions('internal', 'stopped')).toBe(true);
expect(showsManagementActions('external', 'created')).toBe(true);
expect(showsManagementActions(undefined, 'created')).toBe(true);
});
test('git stack that has not been deployed (raw "created") hides actions - only the deploy button shows', () => {
expect(showsManagementActions('git', 'created')).toBe(false);
});
test('a deployed git stack shows its management actions', () => {
expect(showsManagementActions('git', 'running')).toBe(true);
expect(showsManagementActions('git', 'stopped')).toBe(true);
expect(showsManagementActions('git', 'partial')).toBe(true);
});
test('running/stopped stacks of any source show actions', () => {
for (const src of ['internal', 'external', 'git', undefined]) {
expect(showsManagementActions(src, 'running')).toBe(true);
}
});
});