Skip to content

Commit

Permalink
added tests for the scrollspy module
Browse files Browse the repository at this point in the history
  • Loading branch information
Péter Volf committed Jun 17, 2019
1 parent 29788c8 commit 3ceb8da
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions test/test_scrollspy.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
from markyp_bootstrap4.scrollspy import *

def test_spied_by():
assert spied_by("identifier") == {
"data-spy": "scroll",
"data-target": "#identifier",
"data-offset": 0
}

assert spied_by(".identifier") == {
"data-spy": "scroll",
"data-target": ".identifier",
"data-offset": 0
}

assert spied_by("#identifier") == {
"data-spy": "scroll",
"data-target": "#identifier",
"data-offset": 0
}

assert spied_by("identifier", offset=42) == {
"data-spy": "scroll",
"data-target": "#identifier",
"data-offset": 42
}

0 comments on commit 3ceb8da

Please sign in to comment.