Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
T
todomvc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Eugene Shen
todomvc
Commits
bacc2c83
Commit
bacc2c83
authored
Jun 06, 2015
by
Sam Saccone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tests: Extract shared test steps into beforeEach
parent
c87099c8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
11 deletions
+11
-11
tests/test.js
tests/test.js
+11
-11
No files found.
tests/test.js
View file @
bacc2c83
...
...
@@ -140,8 +140,11 @@ module.exports.todoMVCTest = function (frameworkName, baseUrl, speedMode, laxMod
});
test
.
describe
(
'
Mark all as completed
'
,
function
()
{
test
.
it
(
'
should allow me to mark all items as completed
'
,
function
()
{
test
.
beforeEach
(
function
()
{
createStandardItems
();
});
test
.
it
(
'
should allow me to mark all items as completed
'
,
function
()
{
page
.
clickMarkAllCompletedCheckBox
();
testOps
.
assertItemAtIndexIsCompleted
(
0
);
...
...
@@ -150,7 +153,6 @@ module.exports.todoMVCTest = function (frameworkName, baseUrl, speedMode, laxMod
});
test
.
it
(
'
should allow me to clear the completion state of all items
'
,
function
()
{
createStandardItems
();
page
.
clickMarkAllCompletedCheckBox
();
page
.
clickMarkAllCompletedCheckBox
();
...
...
@@ -160,7 +162,6 @@ module.exports.todoMVCTest = function (frameworkName, baseUrl, speedMode, laxMod
});
test
.
it
(
'
complete all checkbox should update state when items are completed / cleared
'
,
function
()
{
createStandardItems
();
page
.
clickMarkAllCompletedCheckBox
();
testOps
.
assertCompleteAllIsChecked
();
...
...
@@ -282,14 +283,16 @@ module.exports.todoMVCTest = function (frameworkName, baseUrl, speedMode, laxMod
test
.
describe
(
'
Clear completed button
'
,
function
()
{
test
.
it
(
'
should display the correct text
'
,
function
()
{
test
.
beforeEach
(
function
()
{
createStandardItems
();
});
test
.
it
(
'
should display the correct text
'
,
function
()
{
page
.
toggleItemAtIndex
(
1
);
testOps
.
assertClearCompleteButtonText
(
'
Clear completed
'
);
});
test
.
it
(
'
should remove completed items when clicked
'
,
function
()
{
createStandardItems
();
page
.
toggleItemAtIndex
(
1
);
page
.
clickClearCompleteButton
();
testOps
.
assertItemCount
(
2
);
...
...
@@ -297,7 +300,6 @@ module.exports.todoMVCTest = function (frameworkName, baseUrl, speedMode, laxMod
});
test
.
it
(
'
should be hidden when there are no items that are completed
'
,
function
()
{
createStandardItems
();
page
.
toggleItemAtIndex
(
1
);
testOps
.
assertClearCompleteButtonIsVisible
();
page
.
clickClearCompleteButton
();
...
...
@@ -331,8 +333,10 @@ module.exports.todoMVCTest = function (frameworkName, baseUrl, speedMode, laxMod
});
test
.
describe
(
'
Routing
'
,
function
()
{
test
.
it
(
'
should allow me to display active items
'
,
function
()
{
test
.
beforeEach
(
function
()
{
createStandardItems
();
});
test
.
it
(
'
should allow me to display active items
'
,
function
()
{
page
.
toggleItemAtIndex
(
1
);
page
.
filterByActiveItems
();
...
...
@@ -359,7 +363,6 @@ module.exports.todoMVCTest = function (frameworkName, baseUrl, speedMode, laxMod
});
test
.
it
(
'
should allow me to display completed items
'
,
function
()
{
createStandardItems
();
page
.
toggleItemAtIndex
(
1
);
page
.
filterByCompletedItems
();
...
...
@@ -367,7 +370,6 @@ module.exports.todoMVCTest = function (frameworkName, baseUrl, speedMode, laxMod
});
test
.
it
(
'
should allow me to display all items
'
,
function
()
{
createStandardItems
();
page
.
toggleItemAtIndex
(
1
);
// apply the other filters first, before returning to the 'all' state
...
...
@@ -379,8 +381,6 @@ module.exports.todoMVCTest = function (frameworkName, baseUrl, speedMode, laxMod
});
test
.
it
(
'
should highlight the currently applied filter
'
,
function
()
{
createStandardItems
();
// initially 'all' should be selected
testOps
.
assertFilterAtIndexIsSelected
(
0
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment