This commit is contained in:
@@ -44,4 +44,23 @@ describe('grouped Settings editor', () => {
|
||||
expect(body).toContain('Expired data cannot be restored by increasing retention.');
|
||||
expect(body).toContain('Player safety checks still apply.');
|
||||
});
|
||||
|
||||
it('keeps settings navigation and cleanup previews available without offering mutations in read-only mode', () => {
|
||||
const body = render(SettingsEditor, {
|
||||
props: {
|
||||
initial: { ...defaultFleetSettings, preparationConcurrency: 7 },
|
||||
readOnly: true
|
||||
}
|
||||
}).body.replaceAll(/<!--.*?-->/g, '');
|
||||
expect(body).toContain('aria-label="Settings sections"');
|
||||
expect(body.match(/<input[^>]*id="settings-search"[^>]*>/)?.[0]).not.toContain('disabled');
|
||||
expect(body).toMatch(/<fieldset[^>]*disabled[^>]*><legend[^>]*>Fleet settings/);
|
||||
expect(body).toMatch(/<input[^>]*id="setting-preparationConcurrency"[^>]*value="7"/);
|
||||
expect(body).toContain('Refresh cleanup preview');
|
||||
expect(body).not.toContain('Save changes');
|
||||
expect(body).not.toContain('Discard');
|
||||
expect(body).not.toContain('Protect record');
|
||||
expect(body).not.toContain('Mark failure resolved');
|
||||
expect(body).not.toContain('All changes saved');
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user