Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
50fd135c
Commit
50fd135c
authored
Oct 15, 2015
by
Christina Roberts
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #10193 from edx/christina/move-require-test
Clean up of common JS specs using RequireJS.
parents
3e5ad298
b67f07af
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
12 additions
and
11 deletions
+12
-11
common/static/common/js/spec/main_requirejs.js
+2
-1
common/static/common/js/spec/utils/edx.utils.validate_spec.js
+6
-4
common/static/common/js/utils/edx.utils.validate.js
+0
-0
common/static/js_test.yml
+0
-1
common/static/js_test_requirejs.yml
+1
-2
lms/static/js/spec/main.js
+1
-1
lms/static/js/student_account/views/FormView.js
+1
-1
lms/static/js_test.yml
+1
-1
No files found.
common/static/js/spec/main_requirejs.js
→
common/static/
common/
js/spec/main_requirejs.js
View file @
50fd135c
...
@@ -162,7 +162,8 @@
...
@@ -162,7 +162,8 @@
'common-requirejs/include/common/js/spec/components/paging_header_spec.js'
,
'common-requirejs/include/common/js/spec/components/paging_header_spec.js'
,
'common-requirejs/include/common/js/spec/components/paging_footer_spec.js'
,
'common-requirejs/include/common/js/spec/components/paging_footer_spec.js'
,
'common-requirejs/include/common/js/spec/components/search_field_spec.js'
,
'common-requirejs/include/common/js/spec/components/search_field_spec.js'
,
'common-requirejs/include/common/js/spec/components/view_utils_spec.js'
'common-requirejs/include/common/js/spec/components/view_utils_spec.js'
,
'common-requirejs/include/common/js/spec/utils/edx.utils.validate_spec.js'
]);
]);
}).
call
(
this
,
requirejs
,
define
);
}).
call
(
this
,
requirejs
,
define
);
common/static/
js/spec
/edx.utils.validate_spec.js
→
common/static/
common/js/spec/utils
/edx.utils.validate_spec.js
View file @
50fd135c
;(
function
(
define
)
{
;(
function
(
define
)
{
'use strict'
;
'use strict'
;
define
([
'jquery'
,
'js/utils/edx.utils.validate'
],
define
([
'jquery'
,
'
common/
js/utils/edx.utils.validate'
],
function
(
$
)
{
function
(
$
,
EdxUtilsValidate
)
{
describe
(
"EdxUtilsValidate"
,
function
()
{
var
fixture
=
null
,
var
fixture
=
null
,
field
=
null
,
field
=
null
,
result
=
null
,
result
=
null
,
...
@@ -31,12 +32,12 @@
...
@@ -31,12 +32,12 @@
};
};
var
expectValid
=
function
()
{
var
expectValid
=
function
()
{
result
=
edx
.
utils
.
validate
(
field
);
result
=
EdxUtilsValidate
.
validate
(
field
);
expect
(
result
.
isValid
).
toBe
(
true
);
expect
(
result
.
isValid
).
toBe
(
true
);
};
};
var
expectInvalid
=
function
(
errorFragment
)
{
var
expectInvalid
=
function
(
errorFragment
)
{
result
=
edx
.
utils
.
validate
(
field
);
result
=
EdxUtilsValidate
.
validate
(
field
);
expect
(
result
.
isValid
).
toBe
(
false
);
expect
(
result
.
isValid
).
toBe
(
false
);
expect
(
result
.
message
).
toMatch
(
errorFragment
);
expect
(
result
.
message
).
toMatch
(
errorFragment
);
};
};
...
@@ -192,4 +193,5 @@
...
@@ -192,4 +193,5 @@
expectInvalid
(
CUSTOM_MESSAGE
);
expectInvalid
(
CUSTOM_MESSAGE
);
});
});
});
});
});
}).
call
(
this
,
define
||
RequireJS
.
define
);
}).
call
(
this
,
define
||
RequireJS
.
define
);
common/static/js/utils/edx.utils.validate.js
→
common/static/
common/
js/utils/edx.utils.validate.js
View file @
50fd135c
File moved
common/static/js_test.yml
View file @
50fd135c
...
@@ -48,7 +48,6 @@ src_paths:
...
@@ -48,7 +48,6 @@ src_paths:
-
js/xblock
-
js/xblock
-
coffee/src
-
coffee/src
-
js/src
-
js/src
-
js/utils
-
js/capa/src
-
js/capa/src
# Paths to spec (test) JavaScript files
# Paths to spec (test) JavaScript files
...
...
common/static/js_test_requirejs.yml
View file @
50fd135c
...
@@ -54,7 +54,6 @@ src_paths:
...
@@ -54,7 +54,6 @@ src_paths:
# Paths to spec (test) JavaScript files
# Paths to spec (test) JavaScript files
spec_paths
:
spec_paths
:
-
common/js/spec
-
common/js/spec
-
js/spec/main_requirejs.js
# Paths to fixture files (optional)
# Paths to fixture files (optional)
# The fixture path will be set automatically when using jasmine-jquery.
# The fixture path will be set automatically when using jasmine-jquery.
...
@@ -70,7 +69,7 @@ fixture_paths:
...
@@ -70,7 +69,7 @@ fixture_paths:
requirejs
:
requirejs
:
paths
:
paths
:
main
:
js/spec/main_requirejs
main
:
common/
js/spec/main_requirejs
# Because require.js is responsible for loading all dependencies, we exclude
# Because require.js is responsible for loading all dependencies, we exclude
# all files from being included in <script> tags
# all files from being included in <script> tags
...
...
lms/static/js/spec/main.js
View file @
50fd135c
...
@@ -89,7 +89,7 @@
...
@@ -89,7 +89,7 @@
'annotator_1.2.9'
:
'xmodule_js/common_static/js/vendor/edxnotes/annotator-full.min'
,
'annotator_1.2.9'
:
'xmodule_js/common_static/js/vendor/edxnotes/annotator-full.min'
,
// Common edx utils
// Common edx utils
'
js/utils/edx.utils.validate'
:
'xmodule_js/common_static
/js/utils/edx.utils.validate'
'
common/js/utils/edx.utils.validate'
:
'xmodule_js/common_static/common
/js/utils/edx.utils.validate'
},
},
shim
:
{
shim
:
{
'gettext'
:
{
'gettext'
:
{
...
...
lms/static/js/student_account/views/FormView.js
View file @
50fd135c
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
'jquery'
,
'jquery'
,
'underscore'
,
'underscore'
,
'backbone'
,
'backbone'
,
'js/utils/edx.utils.validate'
'
common/
js/utils/edx.utils.validate'
],
],
function
(
$
,
_
,
Backbone
,
EdxUtilsValidate
)
{
function
(
$
,
_
,
Backbone
,
EdxUtilsValidate
)
{
...
...
lms/static/js_test.yml
View file @
50fd135c
...
@@ -64,7 +64,7 @@ lib_paths:
...
@@ -64,7 +64,7 @@ lib_paths:
-
xmodule_js/common_static/js/vendor/date.js
-
xmodule_js/common_static/js/vendor/date.js
-
xmodule_js/common_static/js/vendor/moment.min.js
-
xmodule_js/common_static/js/vendor/moment.min.js
-
xmodule_js/common_static/js/vendor/moment-with-locales.min.js
-
xmodule_js/common_static/js/vendor/moment-with-locales.min.js
-
xmodule_js/common_static/js/utils/edx.utils.validate.js
-
xmodule_js/common_static/
common/
js/utils/edx.utils.validate.js
# Paths to source JavaScript files
# Paths to source JavaScript files
src_paths
:
src_paths
:
...
...
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