-
Notifications
You must be signed in to change notification settings - Fork 41
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 #4 from simplabs/add-tests
Add tests
- Loading branch information
Showing
27 changed files
with
389 additions
and
47 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 |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/*jshint node:true*/ | ||
module.exports = { | ||
scenarios: [ | ||
{ | ||
name: 'default', | ||
dependencies: { } | ||
}, | ||
{ | ||
name: 'ember-1-13', | ||
dependencies: { | ||
'ember': 'components/ember#1.13' | ||
}, | ||
resolutions: { | ||
'ember': '1.13' | ||
} | ||
}, | ||
{ | ||
name: 'ember-release', | ||
dependencies: { | ||
'ember': 'components/ember#release' | ||
}, | ||
resolutions: { | ||
'ember': 'release' | ||
} | ||
}, | ||
{ | ||
name: 'ember-beta', | ||
dependencies: { | ||
'ember': 'components/ember#beta' | ||
}, | ||
resolutions: { | ||
'ember': 'beta' | ||
} | ||
}, | ||
{ | ||
name: 'ember-canary', | ||
dependencies: { | ||
'ember': 'components/ember#canary' | ||
}, | ||
resolutions: { | ||
'ember': 'canary' | ||
} | ||
} | ||
] | ||
}; |
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,6 @@ | ||
/*jshint node:true*/ | ||
'use strict'; | ||
|
||
module.exports = function(/* environment, appConfig */) { | ||
return { }; | ||
}; |
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,18 +1,20 @@ | ||
/*jshint node:true*/ | ||
/* global require, module */ | ||
var EmberAddon = require('ember-cli/lib/broccoli/ember-addon'); | ||
var StripTestSelectorsTransform = require('./strip-test-selectors'); | ||
|
||
module.exports = function(defaults) { | ||
var app = new EmberAddon(defaults, { | ||
// Add options here | ||
}); | ||
|
||
/* | ||
This build file specifies the options for the dummy test app of this | ||
addon, located in `/tests/dummy` | ||
This build file does *not* influence how the addon or the app using it | ||
behave. You most likely want to be modifying `./index.js` or app's build file | ||
*/ | ||
// add the StripTestSelectorsTransform to the registry, so the dummy app has | ||
// it added in the HTMLBars build pipeline: all data-test-* attributes are | ||
// therefore stripped | ||
app.registry.add('htmlbars-ast-plugin', { | ||
name: 'strip-test-selectors', | ||
plugin: StripTestSelectorsTransform | ||
}); | ||
|
||
return app.toTree(); | ||
}; |
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 was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
require('mocha-jshint')(); | ||
require('mocha-jshint')({ | ||
paths: ['./strip-test-selectors.js'] | ||
}); |
This file was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
{ | ||
"predef": [ | ||
"document", | ||
"window", | ||
"location", | ||
"setTimeout", | ||
"$", | ||
"-Promise", | ||
"define", | ||
"console", | ||
"visit", | ||
"exists", | ||
"fillIn", | ||
"click", | ||
"keyEvent", | ||
"triggerEvent", | ||
"find", | ||
"findWithAssert", | ||
"wait", | ||
"DS", | ||
"andThen", | ||
"currentURL", | ||
"currentPath", | ||
"currentRouteName" | ||
], | ||
"node": false, | ||
"browser": false, | ||
"boss": true, | ||
"curly": true, | ||
"debug": false, | ||
"devel": false, | ||
"eqeqeq": true, | ||
"evil": true, | ||
"forin": false, | ||
"immed": false, | ||
"laxbreak": false, | ||
"newcap": true, | ||
"noarg": true, | ||
"noempty": false, | ||
"nonew": false, | ||
"nomen": false, | ||
"onevar": false, | ||
"plusplus": false, | ||
"regexp": false, | ||
"undef": true, | ||
"sub": true, | ||
"strict": false, | ||
"white": false, | ||
"eqnull": true, | ||
"esnext": true, | ||
"unused": true | ||
} |
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,18 @@ | ||
import Ember from 'ember'; | ||
import Resolver from './resolver'; | ||
import loadInitializers from 'ember/load-initializers'; | ||
import config from './config/environment'; | ||
|
||
let App; | ||
|
||
Ember.MODEL_FACTORY_INJECTIONS = true; | ||
|
||
App = Ember.Application.extend({ | ||
modulePrefix: config.modulePrefix, | ||
podModulePrefix: config.podModulePrefix, | ||
Resolver | ||
}); | ||
|
||
loadInitializers(App, config.modulePrefix); | ||
|
||
export default App; |
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,25 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<title>Dummy</title> | ||
<meta name="description" content=""> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
|
||
{{content-for "head"}} | ||
|
||
<link rel="stylesheet" href="assets/vendor.css"> | ||
<link rel="stylesheet" href="assets/dummy.css"> | ||
|
||
{{content-for "head-footer"}} | ||
</head> | ||
<body> | ||
{{content-for "body"}} | ||
|
||
<script src="assets/vendor.js"></script> | ||
<script src="assets/dummy.js"></script> | ||
|
||
{{content-for "body-footer"}} | ||
</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,3 @@ | ||
import Resolver from 'ember-resolver'; | ||
|
||
export default Resolver; |
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,11 @@ | ||
import Ember from 'ember'; | ||
import config from './config/environment'; | ||
|
||
const Router = Ember.Router.extend({ | ||
location: config.locationType | ||
}); | ||
|
||
Router.map(function() { | ||
}); | ||
|
||
export default Router; |
Empty file.
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,3 @@ | ||
<h2 id="title">Welcome to Ember</h2> | ||
|
||
{{outlet}} |
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,4 @@ | ||
"Please disperse. Nothing to see here." - Frank Drebin | ||
|
||
This component only exists so we can convenietly use moduleForComponent for the | ||
tests which check that data-test-* attributes are stripped. |
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,47 @@ | ||
/* jshint node: true */ | ||
|
||
module.exports = function(environment) { | ||
var ENV = { | ||
modulePrefix: 'dummy', | ||
environment: environment, | ||
baseURL: '/', | ||
locationType: 'auto', | ||
EmberENV: { | ||
FEATURES: { | ||
// Here you can enable experimental features on an ember canary build | ||
// e.g. 'with-controller': true | ||
} | ||
}, | ||
|
||
APP: { | ||
// Here you can pass flags/options to your application instance | ||
// when it is created | ||
} | ||
}; | ||
|
||
if (environment === 'development') { | ||
// ENV.APP.LOG_RESOLVER = true; | ||
// ENV.APP.LOG_ACTIVE_GENERATION = true; | ||
// ENV.APP.LOG_TRANSITIONS = true; | ||
// ENV.APP.LOG_TRANSITIONS_INTERNAL = true; | ||
// ENV.APP.LOG_VIEW_LOOKUPS = true; | ||
} | ||
|
||
if (environment === 'test') { | ||
// Testem prefers this... | ||
ENV.baseURL = '/'; | ||
ENV.locationType = 'none'; | ||
|
||
// keep test console output quieter | ||
ENV.APP.LOG_ACTIVE_GENERATION = false; | ||
ENV.APP.LOG_VIEW_LOOKUPS = false; | ||
|
||
ENV.APP.rootElement = '#ember-testing'; | ||
} | ||
|
||
if (environment === 'production') { | ||
|
||
} | ||
|
||
return ENV; | ||
}; |
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,15 @@ | ||
<?xml version="1.0"?> | ||
<!DOCTYPE cross-domain-policy SYSTEM "http://www.adobe.com/xml/dtds/cross-domain-policy.dtd"> | ||
<cross-domain-policy> | ||
<!-- Read this: www.adobe.com/devnet/articles/crossdomain_policy_file_spec.html --> | ||
|
||
<!-- Most restrictive policy: --> | ||
<site-control permitted-cross-domain-policies="none"/> | ||
|
||
<!-- Least restrictive policy: --> | ||
<!-- | ||
<site-control permitted-cross-domain-policies="all"/> | ||
<allow-access-from domain="*" to-ports="*" secure="false"/> | ||
<allow-http-request-headers-from domain="*" headers="*" secure="false"/> | ||
--> | ||
</cross-domain-policy> |
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,3 @@ | ||
# http://www.robotstxt.org | ||
User-agent: * | ||
Disallow: |
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,5 @@ | ||
import Ember from 'ember'; | ||
|
||
export default function destroyApp(application) { | ||
Ember.run(application, 'destroy'); | ||
} |
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,23 @@ | ||
import { module } from 'qunit'; | ||
import startApp from '../helpers/start-app'; | ||
import destroyApp from '../helpers/destroy-app'; | ||
|
||
export default function(name, options = {}) { | ||
module(name, { | ||
beforeEach() { | ||
this.application = startApp(); | ||
|
||
if (options.beforeEach) { | ||
options.beforeEach.apply(this, arguments); | ||
} | ||
}, | ||
|
||
afterEach() { | ||
destroyApp(this.application); | ||
|
||
if (options.afterEach) { | ||
options.afterEach.apply(this, arguments); | ||
} | ||
} | ||
}); | ||
} |
Oops, something went wrong.