Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
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
minerva
core
Commits
9ebc6722
There was a problem fetching the pipeline metadata.
Commit
9ebc6722
authored
7 years ago
by
Piotr Gawron
Browse files
Options
Downloads
Patches
Plain Diff
validator to projectId added
parent
9a7bb8e6
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!157
validator to projectId added
Pipeline
#
Changes
2
Pipelines
1
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
frontend-js/src/main/js/gui/admin/AddProjectDialog.js
+1000
-995
1000 additions, 995 deletions
frontend-js/src/main/js/gui/admin/AddProjectDialog.js
frontend-js/src/test/js/gui/admin/AddProjectDialog-test.js
+43
-0
43 additions, 0 deletions
frontend-js/src/test/js/gui/admin/AddProjectDialog-test.js
with
1043 additions
and
995 deletions
frontend-js/src/main/js/gui/admin/AddProjectDialog.js
+
1000
−
995
View file @
9ebc6722
This diff is collapsed.
Click to expand it.
frontend-js/src/test/js/gui/admin/AddProjectDialog-test.js
+
43
−
0
View file @
9ebc6722
...
...
@@ -4,6 +4,8 @@ require("../../mocha-config");
var
AddProjectDialog
=
require
(
'
../../../../main/js/gui/admin/AddProjectDialog
'
);
var
ServerConnector
=
require
(
'
../../ServerConnector-mock
'
);
var
ValidationError
=
require
(
'
../../../../main/js/ValidationError
'
);
var
logger
=
require
(
'
../../logger
'
);
...
...
@@ -155,4 +157,45 @@ describe('AddProjectDialog', function () {
});
});
describe
(
'
checkValidity
'
,
function
()
{
it
(
'
invalid project name
'
,
function
()
{
var
dialog
=
new
AddProjectDialog
({
element
:
testDiv
,
customMap
:
null
});
var
file
=
new
Blob
([
"
<node></node>
"
]);
file
.
name
=
"
test.xml
"
;
return
dialog
.
init
().
then
(
function
()
{
return
dialog
.
callListeners
(
"
onFileUpload
"
,
file
);
}).
then
(
function
()
{
dialog
.
setProjectId
(
"
(invalid id)
"
);
return
dialog
.
checkValidity
().
then
(
function
()
{
assert
.
notOk
(
"
Expected validity to reject
"
);
}).
catch
(
function
(
error
){
assert
.
ok
(
error
instanceof
ValidationError
);
});
}).
then
().
finally
(
function
()
{
return
dialog
.
destroy
();
});
});
it
(
'
valid project name
'
,
function
()
{
var
dialog
=
new
AddProjectDialog
({
element
:
testDiv
,
customMap
:
null
});
var
file
=
new
Blob
([
"
<node></node>
"
]);
file
.
name
=
"
test.xml
"
;
return
dialog
.
init
().
then
(
function
()
{
return
dialog
.
callListeners
(
"
onFileUpload
"
,
file
);
}).
then
(
function
()
{
dialog
.
setProjectId
(
"
-valid_id
"
);
return
dialog
.
checkValidity
();
}).
then
().
finally
(
function
()
{
return
dialog
.
destroy
();
});
});
});
});
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