Skip to content

Commit bb3fb83

Browse files
authored
Enable disburse maturity for NNS neurons (#6942)
# Motivation To simplify the process of claiming matured rewards and avoid the extra steps of creating and disbursing a new neuron, the disburse maturity feature is introduced for NNS neurons (this approach is already used for SNS neurons). This PR switches the feature flag to enable disburse maturity for NNS neurons. # Changes - Enable `ENABLE_DISBURSE_MATURITY` feature flag. - Ran `./scripts/nns-dapp/test-config --update` to update config files. # Tests - Verified locally that the feature is enabled by default. - Since the "Spawn Neuron" button was replaced with "Disburse": - Updated multiple screenshots due to the button change. - Added an end-to-end test for disburse maturity to replace the spawn neuron test (this also updates screenshots, as after disburse maturity the user remains on the neuron details page). # Todos - [x] Accessibility (a11y) – any impact? - [x] Changelog – is it needed?
1 parent 615c28a commit bb3fb83

19 files changed

+70
-9
lines changed

CHANGELOG-Nns-Dapp-unreleased.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ proposal is successful, the changes it released will be moved from this file to
1515
#### Added
1616

1717
* Visual feedback on copy to clipboard actions
18+
* Disburse maturity for NNS neurons
1819

1920
#### Changed
2021

config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@
9898
"FEATURE_FLAGS": {
9999
"ENABLE_CKTESTBTC": false,
100100
"DISABLE_IMPORT_TOKEN_VALIDATION_FOR_TESTING": false,
101-
"ENABLE_DISBURSE_MATURITY": false,
101+
"ENABLE_DISBURSE_MATURITY": true,
102102
"ENABLE_USD_VALUES": true,
103103
"ENABLE_USD_VALUES_FOR_NEURONS": true,
104104
"ENABLE_PORTFOLIO_PAGE": true,

frontend/src/tests/e2e/neurons-table.spec.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,10 @@ const createHotkeyNeuronsInOtherAccount = async ({
6868
.getNnsNeuronDetailPo()
6969
.addHotkey(hotkeyPrincipal);
7070
await appPo.getNeuronDetailPo().getNnsNeuronDetailPo().joinCommunityFund();
71+
72+
// close the success modal that could cover the button
73+
await appPo.getToastsPo().closeAll();
74+
7175
await appPo.getNeuronDetailPo().getNnsNeuronDetailPo().unlockNeuron();
7276
await page.close();
7377
};
@@ -118,20 +122,20 @@ test("Test neurons table", async ({ page, context, browser }) => {
118122
// Reload the page to see the maturity and enable the spawn neuron button.
119123
await page.reload();
120124

121-
step("Spawn a neuron");
122-
await neuronDetail.spawnNeuron({ percentage: 100 });
125+
step("Disburse maturity");
126+
await neuronDetail.disburseMaturity({ percentage: 100 });
123127

124128
step("Wait for the hotkey neurons to be created");
125129
await createHotkeyNeuronsPromise;
126130

127131
await page.reload();
128132

129133
step("Make screenshots");
130-
await appPo.getNeuronsPo().getNnsNeuronsPo().waitForContentLoaded();
134+
await appPo.getNeuronDetailPo().waitForContentLoaded();
131135

132136
await replaceContent({
133137
page,
134-
selectors: ['[data-tid="neuron-id"]'],
138+
selectors: ['[data-tid="identifier"]'],
135139
pattern: /[0-9a-f]{7}...[0-9a-f]{7}/,
136140
replacements: replacementNeuronIds,
137141
});
Loading
Loading
Loading
Loading
Loading
Loading
Loading

0 commit comments

Comments
 (0)