mirror of
https://github.com/olehomelchenko/astrolabe.git
synced 2026-08-08 02:02:33 +00:00
Datasets: URL→inline conversion drops url/fetchedAt
This commit is contained in:
@@ -112,6 +112,21 @@ describe('URL dataset edits & refresh', () => {
|
||||
expect(ds.name).toBe('Remote'); // preserved
|
||||
});
|
||||
|
||||
test('a URL→inline conversion removes the url/fetchedAt keys (not left undefined)', () => {
|
||||
const id = seedUrl();
|
||||
store().startEdit();
|
||||
store().updateForm({ source: 'inline', input: '[{"x":1},{"x":2}]' });
|
||||
const later = new Date('2026-07-01T00:00:00Z');
|
||||
expect(store().save(later)).toBe(true);
|
||||
const ds = store().datasets.find((d) => d.id === id)!;
|
||||
expect(ds.source).toBe('inline');
|
||||
expect(ds.rowCount).toBe(2);
|
||||
// The remote origin is shed entirely — the keys are gone, not present-but-undefined,
|
||||
// so an inline record carries no stale url/fetchedAt.
|
||||
expect('url' in ds).toBe(false);
|
||||
expect('fetchedAt' in ds).toBe(false);
|
||||
});
|
||||
|
||||
test('refreshDataset is a no-op for an inline dataset', () => {
|
||||
store().add(
|
||||
createDataset({ name: 'Inline', data: [{ a: 1 }], format: 'json', source: 'inline', now: T }),
|
||||
|
||||
Reference in New Issue
Block a user