-
Notifications
You must be signed in to change notification settings - Fork 6
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 #3 from isleofcode/feat/tests
Feat/tests
- Loading branch information
Showing
6 changed files
with
77 additions
and
31 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,11 @@ | ||
# Ember-cordova-splash | ||
# ember-cordova-splash | ||
|
||
[![Build Status](https://travis-ci.org/isleofcode/ember-cordova-splash.svg?branch=master)](https://travis-ci.org/isleofcode/ember-cordova-splash) | ||
|
||
Ember service bound to Cordova/Phonegap/Crosswalk splashscreen | ||
management for use in [ember-cordova](https://embercordova.com). See | ||
website for usage. | ||
management for use in [ember-cordova](http://embercordova.com). See | ||
website for detailed usage. | ||
|
||
``` | ||
ember install ember-cordova-splash | ||
``` |
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,23 +1,20 @@ | ||
{ | ||
"name": "ember-cordova-splash", | ||
"version": "0.1.0", | ||
"description": "The default blueprint for ember-cli addons.", | ||
"description": "ember-cordova splash addon", | ||
"homepage": "https://github.com/isleofcode/ember-cordova-splash", | ||
"directories": { | ||
"test": "tests" | ||
}, | ||
|
||
"license": "MIT", | ||
"repository": "", | ||
"engines": { | ||
"node": ">= 0.10.0" | ||
}, | ||
|
||
"author": { | ||
"name": "Alex Blom", | ||
"email": "[email protected]", | ||
"url": "https://isleofcode.com" | ||
}, | ||
|
||
"contributors": [ | ||
{ | ||
"name": "Aidan Nulman", | ||
|
@@ -30,7 +27,10 @@ | |
"url": "https://isleofcode.com" | ||
} | ||
], | ||
|
||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/isleofcode/ember-cordova-splash.git" | ||
}, | ||
"keywords": [ | ||
"ember-addon", | ||
"cordova", | ||
|
@@ -42,29 +42,31 @@ | |
"ember-cordova", | ||
"ember-cordova-splash" | ||
], | ||
|
||
"scripts": { | ||
"test": "ember try:each" | ||
}, | ||
"devDependencies": { | ||
"broccoli-asset-rev": "^2.4.2", | ||
"ember-cli": "2.7.0", | ||
"ember-cli-app-version": "^1.0.0", | ||
"ember-cli-dependency-checker": "^1.2.0", | ||
"ember-cli": "2.11.1", | ||
"ember-cli-app-version": "^2.0.0", | ||
"ember-cli-dependency-checker": "^1.3.0", | ||
"ember-cli-htmlbars": "^1.1.1", | ||
"ember-cli-jshint": "^1.0.0", | ||
"ember-cli-qunit": "^2.0.0", | ||
"ember-cli-release": "^0.2.9", | ||
"ember-cli-sri": "^2.1.0", | ||
"ember-cli-test-loader": "^1.1.0", | ||
"ember-cli-testdouble": "0.1.0", | ||
"ember-cli-uglify": "^1.2.0", | ||
"ember-disable-prototype-extensions": "^1.1.0", | ||
"ember-export-application-global": "^1.0.5", | ||
"ember-load-initializers": "^0.5.1", | ||
"ember-resolver": "^2.0.3", | ||
"loader.js": "^4.0.1" | ||
}, | ||
|
||
"dependencies": { | ||
"ember-cli-babel": "^5.1.6" | ||
}, | ||
|
||
"ember-addon": { | ||
"configPath": "tests/dummy/config" | ||
} | ||
|
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,34 @@ | ||
/* global Event */ | ||
import { moduleFor, test } from 'ember-qunit'; | ||
import td from 'testdouble'; | ||
|
||
const fireDeviceReady = function() { | ||
window.document.dispatchEvent(new Event('deviceready')); | ||
}; | ||
|
||
moduleFor('service:ember-cordova/splash', 'Integration | Service | cordova/splash', { | ||
integration: true, | ||
|
||
afterEach: function() { | ||
td.reset(); | ||
} | ||
}); | ||
|
||
test('proxies show/hide events', function(assert) { | ||
assert.expect(0); | ||
let splashService = this.subject(); | ||
|
||
let pluginDouble = td.object({ | ||
hide: function() {}, | ||
show: function() {} | ||
}); | ||
|
||
window.navigator.splashscreen = pluginDouble; | ||
|
||
splashService.hide(); | ||
splashService.show(); | ||
fireDeviceReady(); | ||
|
||
td.verify(pluginDouble.hide()); | ||
td.verify(pluginDouble.show()); | ||
}); |