mirror of
https://github.com/nimbold/Firelink.git
synced 2026-08-09 18:59:36 +00:00
22 lines
950 B
TypeScript
22 lines
950 B
TypeScript
import { describe, expect, it } from 'vitest';
|
|
import { getPropertiesFooterActions } from './propertiesFooter';
|
|
|
|
describe('Properties footer state', () => {
|
|
it('shows discard, save, and close for ordinary dirty edits', () => {
|
|
expect(getPropertiesFooterActions({ isDirty: true, hasUnsavedNavigation: false }))
|
|
.toEqual(['discardChanges', 'save', 'close']);
|
|
});
|
|
|
|
it('shows discard, save, and keep editing for an unsaved tab or close prompt', () => {
|
|
expect(getPropertiesFooterActions({ isDirty: true, hasUnsavedNavigation: true }))
|
|
.toEqual(['discardChanges', 'save', 'keepEditing']);
|
|
expect(getPropertiesFooterActions({ isDirty: false, hasUnsavedNavigation: true }))
|
|
.toEqual(['discardChanges', 'save', 'keepEditing']);
|
|
});
|
|
|
|
it('keeps close available when there are no edits', () => {
|
|
expect(getPropertiesFooterActions({ isDirty: false, hasUnsavedNavigation: false }))
|
|
.toEqual(['close']);
|
|
});
|
|
});
|