Skip to content

Commit

Permalink
Merge pull request #371 from alphagov/fix-progress-aria
Browse files Browse the repository at this point in the history
Update the aria-valuenow on batch upload
  • Loading branch information
jamiecobbett committed Aug 5, 2014
2 parents 2b63594 + 008a7b3 commit 4286303
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/assets/javascripts/modules/batch_progress.js
Expand Up @@ -36,6 +36,7 @@
percent = (progress.done/progress.total * 100).toFixed(0);
percentDone.text(percent);
bar.css('width', percent + '%');
bar.attr('aria-valuenow', percent);
timeout = setTimeout(requestProgress, 1000);
}

Expand Down
4 changes: 4 additions & 0 deletions spec/javascripts/spec/batch_progress.spec.js
Expand Up @@ -50,6 +50,10 @@ describe('A batch progress module', function() {
expect(element.find('.js-progress-bar').attr('style')).toMatch('width: 10%;');
});

it('updates the aria value now attribute', function() {
expect(element.find('.js-progress-bar').attr('aria-valuenow')).toMatch(10);
});

it('updates the count of done mappings', function() {
expect(element.find('.js-progress-message').text()).toBe('1 of 10 mappings added');
});
Expand Down

0 comments on commit 4286303

Please sign in to comment.