File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -56,6 +56,15 @@ public function testFocus()
5656
5757 $ focusBlurDetector ->focus ();
5858 $ this ->assertEquals ('focused ' , $ focusBlurDetector ->getValue ());
59+
60+ $ focusableAnchor = $ this ->getAssertSession ()->elementExists ('css ' , '.elements a#focusable ' );
61+ $ this ->assertEquals ('no action detected ' , $ focusableAnchor ->getText ());
62+
63+ $ focusableAnchor ->focus ();
64+ // checking that we're on same page
65+ $ this ->getAssertSession ()->addressEquals ('/js_test.html ' );
66+ $ this ->assertEquals ('focused ' , $ focusableAnchor ->getText ());
67+
5968 }
6069
6170 /**
@@ -68,6 +77,8 @@ public function testBlur()
6877 $ focusBlurDetector = $ this ->getAssertSession ()->elementExists ('css ' , '.elements input#focus-blur-detector ' );
6978 $ this ->assertEquals ('no action detected ' , $ focusBlurDetector ->getValue ());
7079
80+ // focusing before, because blur won't be triggered if HTMLElement is not focused
81+ $ focusBlurDetector ->focus ();
7182 $ focusBlurDetector ->blur ();
7283 $ this ->assertEquals ('blured ' , $ focusBlurDetector ->getValue ());
7384 }
You can’t perform that action at this time.
0 commit comments