Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
logging-scratch-gui
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
David Goessmann
logging-scratch-gui
Commits
90d0c14b
Commit
90d0c14b
authored
6 years ago
by
chrisgarrity
Browse files
Options
Downloads
Patches
Plain Diff
Add tests
parent
9d8c80b6
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
test/integration/tutorials-shortcut.test.js
+32
-0
32 additions, 0 deletions
test/integration/tutorials-shortcut.test.js
test/unit/util/tutorial-from-url.test.js
+6
-1
6 additions, 1 deletion
test/unit/util/tutorial-from-url.test.js
with
38 additions
and
1 deletion
test/integration/tutorials-shortcut.test.js
0 → 100644
+
32
−
0
View file @
90d0c14b
import
path
from
'
path
'
;
import
SeleniumHelper
from
'
../helpers/selenium-helper
'
;
const
{
clickText
,
findByXpath
,
getDriver
,
loadUri
}
=
new
SeleniumHelper
();
const
uri
=
path
.
resolve
(
__dirname
,
'
../../build/index.html?tutorial=all
'
);
let
driver
;
describe
(
'
Working with shortcut to Tutorials library
'
,
()
=>
{
beforeAll
(()
=>
{
driver
=
getDriver
();
});
afterAll
(
async
()
=>
{
await
driver
.
quit
();
});
test
(
'
opens with the Tutorial Library showing
'
,
async
()
=>
{
await
loadUri
(
uri
);
// make sure there is a tutorial visible that doesn't have a shortcut
await
clickText
(
'
Switch costume
'
);
await
findByXpath
(
'
//div[contains(@class, "step-video")]
'
);
});
// @todo navigating cards, etc.
});
This diff is collapsed.
Click to expand it.
test/unit/util/tutorial-from-url.test.js
+
6
−
1
View file @
90d0c14b
...
...
@@ -36,7 +36,7 @@ test('returns null if no query param', () => {
expect
(
detectTutorialId
()).
toBe
(
null
);
});
test
(
'
returns null if
non-numeric
template
'
,
()
=>
{
test
(
'
returns null if
unrecognized
template
'
,
()
=>
{
window
.
location
.
search
=
'
?tutorial=asdf
'
;
expect
(
detectTutorialId
()).
toBe
(
null
);
});
...
...
@@ -45,3 +45,8 @@ test('takes the first of multiple', () => {
window
.
location
.
search
=
'
?tutorial=one&tutorial=two
'
;
expect
(
detectTutorialId
()).
toBe
(
'
foo
'
);
});
test
(
'
returns all for the tutorial library shortcut
'
,
()
=>
{
window
.
location
.
search
=
'
?tutorial=all
'
;
expect
(
detectTutorialId
()).
toBe
(
'
all
'
);
});
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment