From dfc4c9077d624481cda94bffb0d4e6b96d51ed8b Mon Sep 17 00:00:00 2001 From: Piotr Sarnacki Date: Thu, 26 Feb 2015 11:35:56 +0100 Subject: [PATCH] Fix favicon specs for async behaviour --- tests/unit/utils/favicon-manager-test.coffee | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/tests/unit/utils/favicon-manager-test.coffee b/tests/unit/utils/favicon-manager-test.coffee index d5013381..b35a7543 100644 --- a/tests/unit/utils/favicon-manager-test.coffee +++ b/tests/unit/utils/favicon-manager-test.coffee @@ -25,9 +25,13 @@ test 'set favicon if there is no link tag in head', -> link = fakeHead.find('link')[0] ok link, 'link tag should be added by favicon manager' - equal link.getAttribute('href'), 'foobar', 'href attribute for the link should be properly set' - equal link.getAttribute('rel'), 'icon', 'rel attribute for the link should be properly set' - equal link.getAttribute('type'), 'image/png', 'type attribute for the link should be properly set' + stop() + setTimeout -> + start() + equal link.getAttribute('href'), 'foobar', 'href attribute for the link should be properly set' + equal link.getAttribute('rel'), 'icon', 'rel attribute for the link should be properly set' + equal link.getAttribute('type'), 'image/png', 'type attribute for the link should be properly set' + , 20 test 'replace exisiting link tag', -> fakeHead.append($('')) @@ -42,9 +46,13 @@ test 'replace exisiting link tag', -> link = links[0] ok !link.getAttribute('id'), 'existing link should be replaced with a new one' - equal link.getAttribute('href'), 'foobar', 'href attribute for the link should be properly set' - equal link.getAttribute('rel'), 'icon', 'rel attribute for the link should be properly set' - equal link.getAttribute('type'), 'image/png', 'type attribute for the link should be properly set' + stop() + setTimeout -> + start() + equal link.getAttribute('href'), 'foobar', 'href attribute for the link should be properly set' + equal link.getAttribute('rel'), 'icon', 'rel attribute for the link should be properly set' + equal link.getAttribute('type'), 'image/png', 'type attribute for the link should be properly set' + , 20 test 'find link with rel=icon only', -> fakeHead.append($(''))