Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
yhabib committed Feb 3, 2025
1 parent 4a114f3 commit 1f3ce5e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
12 changes: 12 additions & 0 deletions packages/nns/src/governance.canister.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,8 @@ describe("GovernanceCanister", () => {
include_neurons_readable_by_caller: true,
include_empty_neurons_readable_by_caller: [true],
include_public_neurons_in_full_neurons: [true],
page_number: [],
page_size: [],
});
expect(certifiedService.list_neurons).toBeCalledTimes(1);
expect(neurons.length).toBe(1);
Expand All @@ -475,6 +477,8 @@ describe("GovernanceCanister", () => {
include_neurons_readable_by_caller: true,
include_empty_neurons_readable_by_caller: [false],
include_public_neurons_in_full_neurons: [],
page_number: [],
page_size: [],
});
expect(service.list_neurons).toBeCalledTimes(1);
expect(neurons.length).toBe(1);
Expand All @@ -499,6 +503,8 @@ describe("GovernanceCanister", () => {
include_neurons_readable_by_caller: true,
include_empty_neurons_readable_by_caller: [],
include_public_neurons_in_full_neurons: [false],
page_number: [],
page_size: [],
});
expect(service.list_neurons).toBeCalledTimes(1);
expect(neurons.length).toBe(1);
Expand All @@ -524,6 +530,10 @@ describe("GovernanceCanister", () => {
include_empty_neurons_readable_by_caller: [],
// The field is present in the argument but ignored by the old service.
include_public_neurons_in_full_neurons: [],
// The field is present in the argument but ignored by the old service.
page_number: [],
// The field is present in the argument but ignored by the old service.
page_size: [],
});
expect(oldService.list_neurons).toBeCalledTimes(1);
expect(neurons.length).toBe(1);
Expand All @@ -549,6 +559,8 @@ describe("GovernanceCanister", () => {
include_neurons_readable_by_caller: true,
include_empty_neurons_readable_by_caller: [],
include_public_neurons_in_full_neurons: [],
page_number: [],
page_size: [],
});
expect(service.list_neurons).toBeCalledTimes(1);
expect(neurons.length).toBe(1);
Expand Down
1 change: 1 addition & 0 deletions packages/nns/src/mocks/governance.mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,5 @@ export const mockNeuron: Neuron = {
export const mockListNeuronsResponse: ListNeuronsResponse = {
neuron_infos: [[mockNeuronId, mockNeuronInfo]],
full_neurons: [mockNeuron],
total_pages_available: [],
};

0 comments on commit 1f3ce5e

Please sign in to comment.