1
0
mirror of https://github.com/ascribe/onion.git synced 2024-12-22 09:23:13 +01:00

Use the 'ascribe-app' class for all apps

Simplifies testing so we can just look for a single class throughout
all the apps when ensuring React has loaded our app
This commit is contained in:
Brett Sun 2016-02-05 14:22:42 +01:00
parent 01b258334a
commit 40894cfea6
11 changed files with 19 additions and 30 deletions

View File

@ -23,7 +23,7 @@ let AscribeApp = React.createClass({
const { activeRoute, children, currentUser, routes, whitelabel } = this.props;
return (
<div className="ascribe-default-app">
<div className="ascribe-app ascribe-default-app">
<Header
currentUser={currentUser}
routes={routes}

View File

@ -56,7 +56,7 @@ let PRApp = React.createClass({
return (
<div
style={style}
className={classNames('ascribe-prize-app', `route--${(path ? path.split('/')[0] : 'landing')}`)}>
className={classNames('ascribe-app', 'ascribe-prize-app', `route--${(path ? path.split('/')[0] : 'landing')}`)}>
{header}
<AppRouteWrapper
currentUser={currentUser}

View File

@ -44,7 +44,7 @@ let PrizeApp = React.createClass({
}
return (
<div className={classNames('ascribe-prize-app', `route--${(path ? path.split('/')[0] : 'landing')}`)}>
<div className={classNames('ascribe-app', 'ascribe-prize-app', `route--${(path ? path.split('/')[0] : 'landing')}`)}>
{header}
<AppRouteWrapper
currentUser={currentUser}

View File

@ -46,7 +46,7 @@ let WalletApp = React.createClass({
// In react-router 1.0, Routes have no 'name' property anymore. To keep functionality however,
// we split the path by the first occurring slash and take the first splitter.
return (
<div className={classNames('ascribe-wallet-app', `route--${(path ? path.split('/')[0] : 'landing')}`)}>
<div className={classNames('ascribe-app', 'ascribe-wallet-app', `route--${(path ? path.split('/')[0] : 'landing')}`)}>
{header}
<AppRouteWrapper
currentUser={currentUser}

View File

@ -15,9 +15,7 @@ gemini.suite('Authenticated', (suite) => {
.before((actions, find) => {
// This will be called before every nested suite begins unless that suite
// also defines a `.before()`
// FIXME: use a more generic class for this, like just '.app',
// when we can use this file with the whitelabels
actions.waitForElementToShow('.ascribe-default-app', TIMEOUTS.NORMAL);
actions.waitForElementToShow('.ascribe-app', TIMEOUTS.NORMAL);
});
// Suite just to log us in before any other suites run

View File

@ -15,8 +15,7 @@ gemini.suite('Basic', (suite) => {
.before((actions, find) => {
// This will be called before every nested suite begins unless that suite
// also defines a `.before()`
// FIXME: use a more generic class for this, like just '.ascribe-app'
actions.waitForElementToShow('.ascribe-default-app', TIMEOUTS.NORMAL);
actions.waitForElementToShow('.ascribe-app', TIMEOUTS.NORMAL);
});
gemini.suite('Header-desktop', (headerSuite) => {

View File

@ -19,9 +19,7 @@ gemini.suite('Work detail', (suite) => {
.before((actions, find) => {
// This will be called before every nested suite begins unless that suite
// also defines a `.before()`
// FIXME: use a more generic class for this, like just '.app',
// when we can use this file with the whitelabels
actions.waitForElementToShow('.ascribe-default-app', TIMEOUTS.NORMAL);
actions.waitForElementToShow('.ascribe-app', TIMEOUTS.NORMAL);
// Wait for the social media buttons to appear
actions.waitForElementToShow('.ascribe-social-button-list .fb-share-button iframe', TIMEOUTS.SUPER_DUPER_EXTRA_LONG);
@ -58,7 +56,7 @@ gemini.suite('Work detail', (suite) => {
.setUrl('/login')
.ignoreElements('.ascribe-body')
.before((actions, find) => {
actions.waitForElementToShow('.ascribe-default-app', TIMEOUTS.NORMAL);
actions.waitForElementToShow('.ascribe-app', TIMEOUTS.NORMAL);
})
.capture('logged in', (actions, find) => {
actions.sendKeys(find('.ascribe-login-wrapper input[name=email]'), MAIN_USER.email);
@ -125,7 +123,7 @@ gemini.suite('Work detail', (suite) => {
.setUrl('/logout')
.ignoreElements('.ascribe-body')
.before((actions, find) => {
actions.waitForElementToShow('.ascribe-default-app', TIMEOUTS.NORMAL);
actions.waitForElementToShow('.ascribe-app', TIMEOUTS.NORMAL);
})
.capture('logout', (actions, find) => {
actions.waitForElementToShow('.ascribe-login-wrapper', TIMEOUTS.LONG);

View File

@ -9,11 +9,10 @@ const TIMEOUTS = environment.TIMEOUTS;
*/
gemini.suite('23vivi', (suite) => {
suite
//TODO: maybe this should be changed to .ascribe-body once the PR that does this is merged
.setCaptureElements('.ascribe-wallet-app')
.setCaptureElements('.ascribe-body')
.before((actions, find) => {
// This will be called before every nested suite begins
actions.waitForElementToShow('.ascribe-wallet-app', TIMEOUTS.NORMAL);
actions.waitForElementToShow('.ascribe-app', TIMEOUTS.NORMAL);
});
gemini.suite('Landing', (landingSuite) => {

View File

@ -9,11 +9,10 @@ const TIMEOUTS = environment.TIMEOUTS;
*/
gemini.suite('Cyland', (suite) => {
suite
//TODO: maybe this should be changed to .ascribe-body once the PR that does this is merged
.setCaptureElements('.ascribe-wallet-app')
.setCaptureElements('.ascribe-body')
.before((actions, find) => {
// This will be called before every nested suite begins
actions.waitForElementToShow('.ascribe-wallet-app', TIMEOUTS.NORMAL);
actions.waitForElementToShow('.ascribe-app', TIMEOUTS.NORMAL);
});
gemini.suite('Landing', (landingSuite) => {

View File

@ -10,11 +10,10 @@ const TIMEOUTS = environment.TIMEOUTS;
*/
gemini.suite('Ikonotv', (suite) => {
suite
//TODO: maybe this should be changed to .ascribe-body once the PR that does this is merged
.setCaptureElements('.ascribe-wallet-app')
.setCaptureElements('.ascribe-body')
.before((actions, find) => {
// This will be called before every nested suite begins
actions.waitForElementToShow('.ascribe-wallet-app', TIMEOUTS.NORMAL);
actions.waitForElementToShow('.ascribe-app', TIMEOUTS.NORMAL);
});
gemini.suite('Landing', (landingSuite) => {
@ -40,13 +39,11 @@ gemini.suite('Ikonotv', (suite) => {
// its logo to appear
gemini.suite('Ikonotv basic', (suite) => {
suite
.setCaptureElements('.ascribe-wallet-app')
.setCaptureElements('.ascribe-app')
.before((actions, find) => {
// This will be called before every nested suite begins unless that suite
// also defines a `.before()`
// FIXME: use a more generic class for this, like just '.app',
// when we can use this file with the whitelabels
actions.waitForElementToShow('.ascribe-wallet-app', TIMEOUTS.NORMAL);
actions.waitForElementToShow('.ascribe-app', TIMEOUTS.NORMAL);
// Wait for the forms to appear
actions.waitForElementToShow('.ascribe-form', TIMEOUTS.NORMAL);

View File

@ -9,11 +9,10 @@ const TIMEOUTS = environment.TIMEOUTS;
*/
gemini.suite('Lumenus', (suite) => {
suite
//TODO: maybe this should be changed to .ascribe-body once the PR that does this is merged
.setCaptureElements('.ascribe-wallet-app')
.setCaptureElements('.ascribe-body')
.before((actions, find) => {
// This will be called before every nested suite begins
actions.waitForElementToShow('.ascribe-wallet-app', TIMEOUTS.NORMAL);
actions.waitForElementToShow('.ascribe-app', TIMEOUTS.NORMAL);
});
gemini.suite('Landing', (landingSuite) => {