Skip to content

Commit

Permalink
Improve topic descriptioins and unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonz-dfinity committed Jul 18, 2024
1 parent 24053f3 commit c145bd2
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 28 deletions.
4 changes: 2 additions & 2 deletions frontend/src/lib/i18n/en.governance.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"ApiBoundaryNodeManagement": "Proposals related to the management of API boundary nodes.",
"SubnetRental": "Proposals related to renting a subnet — for example a subnet rental request.",
"ProtocolCanisterManagement": "Proposals related to managing canisters that are considered as part of the IC protocol.",
"ServiceNervousSystemManagement": "All proposals related to managing the service nervous system (SNS)."
"ServiceNervousSystemManagement": "All proposals related to managing the canisters related to service nervous system (SNS)."
},
"rewards": {
"Unknown": "Unknown",
Expand Down Expand Up @@ -212,4 +212,4 @@
"DeployHostosToSomeNodes": "Deploy a HostOS version to a given set of nodes. The proposal changes the HostOS version that is used on the specified nodes.",
"SubnetRentalRequest": "A proposal to rent a subnet on the Internet Computer.<br/><br/>The Subnet Rental Canister is called when this proposal is executed, and the rental request is stored there. The user specified in the proposal needs to make a sufficient upfront payment in ICP in order for the proposal to be valid, and the subnet must be available for rent. The available rental conditions can be checked by calling the Subnet Rental Canister."
}
}
}
4 changes: 2 additions & 2 deletions frontend/src/lib/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@
"topic_17_title": "Protocol Canister Management",
"topic_17_subtitle": "Proposals related to managing canisters that are considered as part of the IC protocol.",
"topic_18_title": "Service Nervous System Management",
"topic_18_subtitle": "Proposals related to managing the service nervous system (SNS).",
"topic_18_subtitle": "Proposals related to managing the canisters related to service nervous system (SNS).",
"current_followees": "Currently Following",
"add": "Add Followee"
},
Expand Down Expand Up @@ -1032,4 +1032,4 @@
"show_all": "Show all",
"import_token": "Import Token"
}
}
}
76 changes: 52 additions & 24 deletions frontend/src/tests/lib/utils/neuron.utils.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2169,37 +2169,65 @@ describe("neuron-utils", () => {

it("should not return deprecated or disabled topics", () => {
expect(topicsToFollow(neuronWithoutManageNeuron)).toEqual(
TOPICS_TO_FOLLOW_NNS.filter(
(topic) =>
topic !== Topic.ManageNeuron &&
!DEPRECATED_TOPICS.includes(topic) &&
!TOPICS_WITH_FOLLOWING_DISABLED.includes(topic)
)
[
Topic.Unspecified,
Topic.Governance,
Topic.SnsAndCommunityFund,
Topic.NetworkEconomics,
Topic.NodeAdmin,
Topic.ParticipantManagement,
Topic.SubnetManagement,
Topic.NetworkCanisterManagement,
Topic.Kyc,
Topic.NodeProviderRewards,
Topic.SubnetReplicaVersionManagement,
Topic.ReplicaVersionManagement,
Topic.ApiBoundaryNodeManagement,
Topic.SubnetRental,
Topic.ExchangeRate,
]
);
expect(topicsToFollow(neuronWithoutFollowees)).toEqual(
TOPICS_TO_FOLLOW_NNS.filter(
(topic) =>
topic !== Topic.ManageNeuron &&
!DEPRECATED_TOPICS.includes(topic) &&
!TOPICS_WITH_FOLLOWING_DISABLED.includes(topic)
)
);
expect(topicsToFollow(neuronWithManageNeuron)).toEqual(
TOPICS_TO_FOLLOW_NNS.filter(
(topic) =>
!DEPRECATED_TOPICS.includes(topic) &&
!TOPICS_WITH_FOLLOWING_DISABLED.includes(topic)
)
[
Topic.Unspecified,
Topic.Governance,
Topic.SnsAndCommunityFund,
Topic.NetworkEconomics,
Topic.NodeAdmin,
Topic.ParticipantManagement,
Topic.SubnetManagement,
Topic.NetworkCanisterManagement,
Topic.Kyc,
Topic.NodeProviderRewards,
Topic.SubnetReplicaVersionManagement,
Topic.ReplicaVersionManagement,
Topic.ApiBoundaryNodeManagement,
Topic.SubnetRental,
Topic.ExchangeRate,
]
);
});

it("should return topics with ManageNeuron if neuron follows some neuron on the ManageNeuron topic", () => {
expect(topicsToFollow(neuronWithManageNeuron)).toEqual(
TOPICS_TO_FOLLOW_NNS.filter(
(topic) =>
!DEPRECATED_TOPICS.includes(topic) &&
!TOPICS_WITH_FOLLOWING_DISABLED.includes(topic)
)
[
Topic.Unspecified,
Topic.Governance,
Topic.SnsAndCommunityFund,
Topic.ManageNeuron,
Topic.NetworkEconomics,
Topic.NodeAdmin,
Topic.ParticipantManagement,
Topic.SubnetManagement,
Topic.NetworkCanisterManagement,
Topic.Kyc,
Topic.NodeProviderRewards,
Topic.SubnetReplicaVersionManagement,
Topic.ReplicaVersionManagement,
Topic.ApiBoundaryNodeManagement,
Topic.SubnetRental,
Topic.ExchangeRate,
]
);
});
});
Expand Down

0 comments on commit c145bd2

Please sign in to comment.