Built with blockbuilder.org
Last active
April 28, 2017 19:24
-
-
Save ocarneiro/a9817bf66684d0827a5429df75897c03 to your computer and use it in GitHub Desktop.
tdd interno primeiro
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
license: mit |
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
<!DOCTYPE html> | |
<head> | |
<meta charset="utf-8"> | |
<script src="https://d3js.org/d3.v4.min.js"></script> | |
<style> | |
body { margin:0;position:fixed;top:0;right:0;bottom:0;left:0; } | |
</style> | |
</head> | |
<body> | |
<svg width=300 height=300><circle cx=120 cy=120 r=100 style="fill:red" /></svg> | |
<script> | |
var circle = d3.select("circle"); | |
function internoPrimeiro(data) { | |
if (data[0].tipo == "interno") { | |
return data; | |
} | |
return []; | |
} | |
var data = [{"tipo": "externo"}, {"tipo": "interno"}]; | |
var output = internoPrimeiro(data); | |
if (output.length == 2 && output[0].tipo == "interno") { | |
success(); | |
} | |
function success() { | |
circle.attr("style", "fill:green"); | |
} | |
</script> | |
</body> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment