Merge pull request #3673 from alphagov/remove-page-title-hack-from-autofocus

Don't prefix with the page title when focusing on load
This commit is contained in:
Tom Byers
2020-10-09 13:42:26 +01:00
committed by GitHub
2 changed files with 1 additions and 35 deletions

View File

@@ -50,28 +50,6 @@ describe('Autofocus', () => {
});
test('has a label including the page title when the module starts', () => {
// start module
window.GOVUK.modules.start();
expect(search.hasAttribute('aria-label')).toBe(true);
expect(search.getAttribute('aria-label')).toEqual(document.title + ' - ' + labelText);
});
test('gets the original label back when focus moves away', () => {
// start module
window.GOVUK.modules.start();
// shift focus away from textbox
helpers.triggerEvent(search, 'blur');
expect(search.hasAttribute('aria-label')).toBe(false);
});
test('is not focused if the window has scrolled', () => {
// mock the window being scrolled 25px