forked from rlamana/ventus
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request rlamana#22 from macqm/closing-fix
Added fix for closed window state and tests
- Loading branch information
Showing
11 changed files
with
11,491 additions
and
49 deletions.
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
Large diffs are not rendered by default.
Oops, something went wrong.
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,36 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>Window tests</title> | ||
<link rel="stylesheet" media="all" href="../vendor/mocha.css"> | ||
</head> | ||
<body> | ||
<div id="mocha"><p><a href=".">Index</a></p></div> | ||
<div id="messages"></div> | ||
<div id="fixtures"></div> | ||
<!-- Require test libraries --> | ||
<script src="../vendor/mocha.js"></script> | ||
<script src="../vendor/chai.js"></script> | ||
|
||
<!-- Require Ventus with dependencies --> | ||
<script src="../vendor/jquery.js"></script> | ||
<script src="../vendor/handlebars.js"></script>< | ||
<script src="../dist/Ventus.js"></script> | ||
|
||
<!-- Set up mocha --> | ||
<script>mocha.setup('bdd')</script> | ||
|
||
<!-- Require the test --> | ||
<script src="window.test.js"></script> | ||
|
||
<!-- Run mocha --> | ||
<script> | ||
if (window.mochaPhantomJS) { | ||
mochaPhantomJS.run(); | ||
} else { | ||
mocha.run(); | ||
} | ||
</script> | ||
</body> | ||
</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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
var expect = chai.expect; | ||
|
||
describe("Window", function() { | ||
|
||
var wm; | ||
var testWindow; | ||
|
||
beforeEach(function() { | ||
wm = new Ventus.WindowManager(); | ||
testWindow = wm.createWindow({title: "test"}); | ||
}); | ||
|
||
it("new window should be in closed state", function() { | ||
expect(testWindow.closed).to.equal(true); | ||
}); | ||
|
||
it("sets is initialized with opened state", function() { | ||
testWindow.open(); | ||
expect(testWindow.closed).to.equal(false); | ||
}); | ||
|
||
it("sets closed state to true when closed", function() { | ||
testWindow.open(); | ||
testWindow.close(); | ||
expect(testWindow.closed).to.equal(true); | ||
}); | ||
|
||
}); |
Oops, something went wrong.