Skip to content
This repository has been archived by the owner on Nov 19, 2019. It is now read-only.

Commit

Permalink
added a given for small screen size and make dialog depend on the bui…
Browse files Browse the repository at this point in the history
…lt form
  • Loading branch information
travi committed Nov 5, 2014
1 parent fbf0227 commit b714c33
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 17 deletions.
2 changes: 1 addition & 1 deletion config/uiDependencies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ dialog:
jsDependencies:
- framework
- jqueryUi
- /resources/thirdparty/travi-ui/js/form/validationMapper.js
- /resources/thirdparty/travi-ui/dist/form.min.js

entityList:
local: /resources/thirdparty/travi-ui/js/entityList.js
Expand Down
32 changes: 26 additions & 6 deletions test/php/acceptance/features/bootstrap/DependenciesContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,19 +61,19 @@ public function initializeApplication()
}

/**
* @Given /^no dependencies are defined$/
* @AfterScenario
*/
public function noDependenciesAreDefined()
public function unsetScreenSizeCookie()
{

$_COOKIE = array();
}

/**
* @Given /^"([^"]*)" defined as a dependency$/
* @Given /^no dependencies are defined$/
*/
public function definedAsADependency($dependency)
public function noDependenciesAreDefined()
{
$this->dependencyManager->addJavaScript($dependency);

}

/**
Expand All @@ -86,6 +86,26 @@ public function environmentIs($environment)
}
}

/**
* @Given /^device has a "([^"]*)" screen size$/
*/
public function deviceHasAScreenSize($screenSize)
{
if ("small" === $screenSize) {
$_COOKIE['ev'] = 'm';
} elseif ("large" === $screenSize) {
$_COOKIE['ev'] = 'l';
}
}

/**
* @Given /^"([^"]*)" defined as a dependency$/
*/
public function definedAsADependency($dependency)
{
$this->dependencyManager->addJavaScript($dependency);
}

/**
* @When /^page is rendered$/
*/
Expand Down
20 changes: 10 additions & 10 deletions test/php/acceptance/features/dependencies.feature
Original file line number Diff line number Diff line change
Expand Up @@ -33,22 +33,22 @@ Feature: Front-end Dependency Management

Scenario:
Given environment is "local"
# And device has a "small" screen size
And device has a "small" screen size
And "dialog" defined as a dependency
When page is rendered
Then the dependencies lists should contain
| js | css | templates |
| /resources/thirdparty/jquery/jquery.js | http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/themes/smoothness/jquery-ui.min.css | /resources/thirdparty/travi-core/templates/enhancementVersion.tmpl |
| /resources/thirdparty/amplify/amplify.core.js | | |
| /resources/thirdparty/jsrender/jsrender.js | | |
| /resources/thirdparty/travi-core/dist/travi-core.min.js | | |
| /resources/thirdparty/jquery-ui/jquery-ui.js | | |
| /resources/thirdparty/travi-ui/js/form/validationMapper.js | | |
| /resources/thirdparty/travi-ui/dist/dialog.min.js | | |
| js | css | templates |
| /resources/thirdparty/jquery/jquery.js | http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/themes/smoothness/jquery-ui.min.css | /resources/thirdparty/travi-core/templates/enhancementVersion.tmpl |
| /resources/thirdparty/amplify/amplify.core.js | | |
| /resources/thirdparty/jsrender/jsrender.js | | |
| /resources/thirdparty/travi-core/dist/travi-core.min.js | | |
| /resources/thirdparty/jquery-ui/jquery-ui.js | | |
| /resources/thirdparty/travi-ui/dist/form.min.js | | |
| /resources/thirdparty/travi-ui/dist/dialog.min.js | | |

Scenario:
Given environment is "local"
# And device has a "small" screen size
And device has a "small" screen size
And "entityList" defined as a dependency
When page is rendered
Then the dependencies lists should contain
Expand Down

0 comments on commit b714c33

Please sign in to comment.