This repository has been archived by the owner on Feb 2, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prepare for an (aspirational) JavaScript testing environment.
This commit includes BackboneJS as part of our `package.json`'s `devDependencies` and configures Karma to load it as necessary. This means we are mostly ready for testing Backbone components when and if we figure out what, exactly, we'd like to test. Previous to this commit, there was a rather contrived test for a single method. However, that was only ever being used in one place, so I've refactored it and removed it from the test suite as it's a single jQuery call, anyway.
- Loading branch information
Showing
5 changed files
with
35 additions
and
23 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
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
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,8 +1,33 @@ | ||
/** | ||
* Aspirational JavaScript testing file for Buoy client-side. | ||
* | ||
* @file Client-side Buoy tests. | ||
* | ||
* @see {@link https://github.com/betterangels/buoy/wiki/Setting-up-a-development-environment#running-tests} | ||
* | ||
* @todo Look into SinonJS for mocking Ajax calls and other difficult | ||
* testing stuff. | ||
*/ | ||
|
||
'use strict'; | ||
|
||
describe("BUOY main class", function() { | ||
it("counts number of menu items", function() { | ||
$(document.body).append('<div id="wp-admin-bar-buoy-alerts-menu"> <a> test </a> <a> test2 </a> </div>') | ||
expect(BUOY.countIncidentMenuItems()).toBe(2) | ||
}); | ||
/** | ||
* Main Buoy module tests. | ||
*/ | ||
describe("Buoy main class", function() { | ||
// TODO | ||
}); | ||
|
||
/** | ||
* Buoy Alert module tests. | ||
*/ | ||
describe('Buoy Alert module', function () { | ||
// TODO | ||
}); | ||
|
||
/** | ||
* Buoy Map module tests. | ||
*/ | ||
describe('Buoy Map module', function () { | ||
// TODO | ||
}); |