Commit 60f140f2 authored by Alejandro Celaya's avatar Alejandro Celaya Committed by Alejandro Celaya

Test accessible message toasted on new annotations in TopBar

parent 5ef88196
......@@ -75,17 +75,29 @@ describe('TopBar', () => {
);
}
it('shows the pending update count', () => {
fakeStore.pendingUpdateCount.returns(1);
const wrapper = createTopBar();
const applyBtn = getButton(wrapper, 'RefreshIcon');
assert.isTrue(applyBtn.exists());
[1, 10, 50].forEach(pendingUpdateCount => {
it('shows the pending update count', () => {
fakeStore.pendingUpdateCount.returns(pendingUpdateCount);
const wrapper = createTopBar();
const applyBtn = getButton(wrapper, 'RefreshIcon');
assert.isTrue(applyBtn.exists());
assert.calledWith(
fakeToastMessenger.success,
`There are ${pendingUpdateCount} new annotations.`,
{
visuallyHidden: true,
}
);
});
});
it('does not show the pending update count when there are no updates', () => {
const wrapper = createTopBar();
const applyBtn = getButton(wrapper, 'RefreshIcon');
assert.isFalse(applyBtn.exists());
assert.notCalled(fakeToastMessenger.success);
});
it('applies updates when clicked', () => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment