Skip to content

Commit

Permalink
Add test for empty list
Browse files Browse the repository at this point in the history
  • Loading branch information
mstrasinskis committed Nov 22, 2024
1 parent fe013e5 commit 0577e1c
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions frontend/src/tests/lib/stores/neurons.store.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,14 @@ describe("neurons-store", () => {
},
};

it("should return empty list when no neurons", () => {
neuronsStore.setNeurons({
neurons: [],
certified: true,
});
expect(get(soonLosingRewardNeuronsStore)).toEqual([]);
});

it("should include only neurons that will soon losing its rewards", () => {
neuronsStore.setNeurons({
neurons: [neuron3, freshNeuron, neuron2, neuron1],
Expand All @@ -225,6 +233,7 @@ describe("neurons-store", () => {
neuron1,
]);
});

it("should sort neurons by votingPowerRefreshedTimestampSeconds", () => {
neuronsStore.setNeurons({
neurons: [neuron2, neuron1, neuron3],
Expand Down

0 comments on commit 0577e1c

Please sign in to comment.