05. Highlight Active
Идея защо при мен си работи а Judge не ?
https://judge.softuni.bg/Contests/Practice/Index/2238#4
https://pastebin.com/VMSC9DZi
let focusEvent = document.createEvent('UIEvents');
focusEvent.initEvent('focus', true, true);
let blurEvent = document.createEvent('UIEvents');
blurEvent.initEvent('blur', true, true);
// Focus second div
let div = document.getElementById('d2');
div.querySelector('input').dispatchEvent(focusEvent);
let allDivs = document.querySelectorAll('div div');
expect(allDivs[0].className).to.not.contains('focused', "Wrong div was highlighted");
expect(allDivs[1].className).to.contains('focused', "Div was not highlighted");
expect(allDivs[2].className).to.not.contains('focused', "Wrong div was highlighted");
expect(allDivs[3].className).to.not.contains('focused', "Wrong div was highlighted");
Unexpected error: Div was not highlighted: expected '' to include 'focused'
Здравейте,
Въпреки, 2-те години по-късно, още едно решение се надявам да бъде от полза за някого търсещ - както бях аз.
Благодаря на v.vachev и Iskren.1990 за подхода и съветите им тук.