-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
write tests that assert the markers are shown or hidden as in the new example code #52
Merged
Merged
Changes from 9 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
d3b043a
heatmap color remains same
sagarpreet-chadha 226e3bd
over ride method for zoomlevel , precision created
sagarpreet-chadha 112185d
Update README.md
sagarpreet-chadha 7b2b458
testing init
sagarpreet-chadha 199ca0d
jasmine.json changed
sagarpreet-chadha 174de81
tests added
sagarpreet-chadha 21152a7
done changes
sagarpreet-chadha 6a753c4
conflicts resolved
sagarpreet-chadha 1be8a18
changes recommended by jeff
sagarpreet-chadha dae107f
test
sagarpreet-chadha 05b4496
gruntfile modified
sagarpreet-chadha a605c73
last test runs now/fixtures are loaded now
sagarpreet-chadha 8a24f89
Merge branch 'main' into feature_testing
sagarpreet-chadha afe7aec
specRunner added
sagarpreet-chadha 095a060
tests running now :)
sagarpreet-chadha File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
|
||
<title>Leaflet.BlurredLocationDisplay</title> | ||
|
||
</head> | ||
|
||
<body> | ||
|
||
<div class="container" > | ||
|
||
<h1>Leaflet BlurredLocationDisplay <small>| by <a href="">Public Lab</a></small></h1> | ||
|
||
<p>This page shows how different markers are shown according to their precision at different zoom levels .</p> | ||
|
||
<hr /> | ||
|
||
<p> | ||
<h3>1.) At zoom level = 5 , all 7 markers are shown : </h3> | ||
<div style="background-color: #d6dfe0;"> | ||
<span style="color: Red"> [23.1 , 77.1] </span>, <br> | ||
<span style="color: Red"> [20.1 , 76.1] </span>, <br> | ||
<span style="color: Green"> [21.111 , 76.111] </span>,<br> | ||
<span style="color: Green">[22.111 , 78.111]</span>,<br> | ||
<span style="color: Black">[23.1234 , 76.1234]</span>,<br> | ||
<span style="color: Yellow"> [24.123456 , 78.123456]</span>,<br> | ||
<span style="color: Yellow"> [25.123456 , 77.123456]</span> | ||
</div> | ||
<div id="map1" class="leaflet-map" style="width: 100%; height: 400px;"></div> | ||
<br><br> | ||
<h3>2.) At zoom level = 6 , 5 markers are shown : </h3> | ||
<div style="background-color: #d6dfe0;"> | ||
<span style="color: Green"> [21.111 , 76.111]</span>,<br> | ||
<span style="color: Green"> [22.111 , 78.111]</span>,<br> | ||
<span style="color: Black"> [23.1234 , 76.1234]</span>,<br> | ||
<span style="color: Yellow"> [24.123456 , 78.123456]</span>,<br> | ||
<span style="color: Yellow"> [25.123456 , 77.123456]</span> | ||
</div> | ||
<div id="map2" class="leaflet-map" style="width: 100%; height: 400px;"></div> | ||
<br><br> | ||
<h3>3.) At zoom level = 8 , 3 markers are shown : </h3> | ||
<div style="background-color: #d6dfe0;"> | ||
<span style="color: Black"> [23.1234 , 76.1234]</span>,<br> | ||
<span style="color: Yellow"> [24.123456 , 78.123456]</span>,<br> | ||
<span style="color: Yellow"> [25.123456 , 77.123456]</span> | ||
</div> | ||
<div id="map3" class="leaflet-map" style="width: 100%; height: 400px;"></div> | ||
|
||
<br /> | ||
|
||
</div> | ||
|
||
<style> | ||
html { background: #f8f8f8; margin-bottom: 100px;} | ||
body { background: none; } | ||
</style> | ||
|
||
|
||
</body> | ||
|
||
|
||
<script> | ||
|
||
var options1 = { | ||
mapID: 'map1' | ||
} | ||
var options2 = { | ||
mapID: 'map2' | ||
} | ||
var options3 = { | ||
mapID: 'map3' | ||
} | ||
|
||
|
||
var BlurredLocation1 = new BlurredLocation(options1) ; | ||
|
||
var BlurredLocation2 = new BlurredLocation(options2) ; | ||
|
||
var BlurredLocation3 = new BlurredLocation(options3) ; | ||
|
||
var locations = [[23.1 , 77.1], | ||
[20.1 , 76.1], | ||
[21.111 , 76.111], | ||
[22.111 , 78.111], | ||
[23.1234 , 76.1234], | ||
[24.123456 , 78.123456], | ||
[25.123456 , 77.123456]]; | ||
|
||
var options_display1 = { | ||
blurredLocation: BlurredLocation1, | ||
locations: locations | ||
}; | ||
var options_display2 = { | ||
blurredLocation: BlurredLocation2, | ||
locations: locations | ||
}; | ||
var options_display3 = { | ||
blurredLocation: BlurredLocation3, | ||
locations: locations | ||
}; | ||
|
||
var blurredLocationDisplay1 = new BlurredLocationDisplay(options_display1); | ||
var blurredLocationDisplay2 = new BlurredLocationDisplay(options_display2); | ||
var blurredLocationDisplay3 = new BlurredLocationDisplay(options_display3); | ||
|
||
BlurredLocation1.map.setView([23,77] , 5) ; | ||
BlurredLocation2.map.setView([23,77] , 6) ; | ||
BlurredLocation3.map.setView([24.23694700391752, 76.89880371093751] , 8) ; | ||
|
||
</script> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,31 @@ | ||
describe("Basic testing", function() { | ||
"use strict"; | ||
|
||
var fixture = loadFixtures('example.html'); | ||
|
||
it("Basic Test", function () { | ||
expect(true).toBe(true); | ||
}); | ||
|
||
it("Checks if at zoom level 5 , all 7 markers are shown", function () { | ||
//BlurredLocation1.map.setZoom(5); | ||
expect($("#map1").children()[0].childNodes[3].childNodes.length).toBe(0) ; | ||
}); | ||
|
||
it("Checks if at zoom level 6 , only 5 markers are shown", function () { | ||
//BlurredLocation2.map.setZoom(6); | ||
expect($("#map2").children()[0].childNodes[3].childNodes.length).toBe(0) ; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
}); | ||
|
||
it("Checks if at zoom level 8 , only 3 markers are shown", function () { | ||
// BlurredLocation3.map.setZoom(8); | ||
expect($("#map3").children()[0].childNodes[3].childNodes.length).toBe(0) ; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
}); | ||
|
||
it("maps are loaded", function () { | ||
expect($("#map1")).toBeInDOM() ; | ||
expect($("#map2")).toBeInDOM() ; | ||
expect($("#map3")).toBeInDOM() ; | ||
}); | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
{ | ||
"spec_dir": "spec", | ||
"spec_files": [ | ||
"**/*[sS]pec.js" | ||
"spec/**/*.js" | ||
], | ||
"helpers": [ | ||
"helpers/**/*.js" | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
expect($("#map1").children()[0].childNodes[3].childNodes.length).toBe(7) ;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @rexagod , yes i did that purposely to tell you guys that in testing , markers are not getting loaded on map 😄 !