Commit 4a22a97e authored by Phil Hughes's avatar Phil Hughes

added specs to stores allBlobs getter

parent a35391c9
...@@ -72,4 +72,24 @@ describe('IDE store getters', () => { ...@@ -72,4 +72,24 @@ describe('IDE store getters', () => {
expect(getters.currentMergeRequest(localState)).toBeNull(); expect(getters.currentMergeRequest(localState)).toBeNull();
}); });
}); });
describe('allBlobs', () => {
beforeEach(() => {
Object.assign(localState.entries, {
index: { type: 'blob', name: 'index', lastOpenedAt: 0 },
app: { type: 'blob', name: 'blob', lastOpenedAt: 0 },
folder: { type: 'folder', name: 'folder', lastOpenedAt: 0 },
});
});
it('returns only blobs', () => {
expect(getters.allBlobs(localState).length).toBe(2);
});
it('returns list sorted by lastOpenedAt', () => {
localState.entries.app.lastOpenedAt = new Date().getTime();
expect(getters.allBlobs(localState)[0].name).toBe('blob');
});
});
}); });
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment