Skip to content

Commit

Permalink
feat(neuron-ui): dismiss pinned top alert if it's related to auto-dis…
Browse files Browse the repository at this point in the history
…missed notifications
  • Loading branch information
Keith-CY committed Oct 11, 2019
1 parent 9de23cc commit b1ea6d5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 4 additions & 0 deletions packages/neuron-ui/src/states/stateProvider/reducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,10 @@ export const reducer = (
messages: {
...app.messages,
},
showTopAlert: !(
app.notifications[app.notifications.length - 1] &&
app.notifications[app.notifications.length - 1].code === payload
),
notifications: app.notifications.filter(({ code }) => code !== payload),
},
}
Expand Down
5 changes: 2 additions & 3 deletions packages/neuron-wallet/tests-e2e/tests/notification.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,8 @@ export default (app: Application) => {
client.click('button[type=submit]')
await app.waitUntilLoaded()
sleep(4000)
const alertComponent = await client.$('.ms-MessageBar-text')
const msg = await client.elementIdText(alertComponent.value.ELEMENT)
expect(msg.value).toBe(messages.disconnected)
const alertComponent = await client.$('.ms-MessageBar--error')
expect(alertComponent.state).toBe('failure')
})
})
}

0 comments on commit b1ea6d5

Please sign in to comment.