Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1 +1 @@
/frontend/tests/*
/frontend/tests/dist/*
51 changes: 27 additions & 24 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,26 +1,29 @@
{
"env": {
"browser": true,
"commonjs": true,
"es6": true
},
"extends": "eslint:recommended",
"plugins": ["vue"],
"parserOptions": {
"sourceType": "module"
},
"rules": {
"indent": [
"error",
2
],
"linebreak-style": [
"error",
"unix"
],
"semi": [
"error",
"always"
]
}
"env": {
"browser": true,
"commonjs": true,
"es6": true
},
"extends": "eslint:recommended",
"plugins": ["vue"],
"parserOptions": {
"sourceType": "module"
},
"rules": {
"indent": [
"error",
2
],
"linebreak-style": [
"error",
"unix"
],
"semi": [
"error",
"always"
]
},
"globals": {
"QUnit": true
}
}
60 changes: 30 additions & 30 deletions bower.json
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
{
"name": "simphony-remote-deps",
"version": "0.0.0",
"homepage": "https://github.com/simphony/simphony-remote",
"authors": [
"Stefano Borini <sborini@enthought.com>"
],
"ignore": [
"**/.*",
"node_modules",
"test",
"tests"
],
"dependencies": {
"bootstrap": "components/bootstrap#~3.3.7",
"font-awesome": "~4.5",
"ionicons": "~2.0.1",
"jquery": "components/jquery#~2.0",
"datatables.net": "~1.10.12",
"datatables.net-dt": "~1.10.12",
"admin-lte": "~2.3.11",
"html5shiv": "~3.7.3",
"respond": "~1.4.2",
"vue": "^2.2.6",
"vue-router": "^2.5.2",
"vue-form": "^4.0.0",
"lodash": "~4.17.4"
},
"devDependencies": {
"blanket": "^1.1.7"
}
"name": "simphony-remote-deps",
"version": "0.0.0",
"homepage": "https://github.com/simphony/simphony-remote",
"authors": [
"Stefano Borini <sborini@enthought.com>"
],
"ignore": [
"**/.*",
"node_modules",
"test",
"tests"
],
"dependencies": {
"bootstrap": "components/bootstrap#~3.3.7",
"font-awesome": "~4.5",
"ionicons": "~2.0.1",
"jquery": "components/jquery#~2.0",
"datatables.net": "~1.10.12",
"datatables.net-dt": "~1.10.12",
"admin-lte": "~2.3.11",
"html5shiv": "~3.7.3",
"respond": "~1.4.2",
"vue": "^2.2.6",
"vue-router": "^2.5.2",
"vue-form": "^4.0.0",
"lodash": "~4.17.4"
},
"devDependencies": {
"blanket": "^1.1.7"
}
}
8 changes: 4 additions & 4 deletions frontend/tests/helpers.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
var Vue = require("vuejs");

var getRenderedText = function(Component, propsData) {
var Ctor = Vue.extend(Component);
var vm = new Ctor({ propsData: propsData }).$mount();
return vm.$el.textContent;
var Ctor = Vue.extend(Component);
var vm = new Ctor({ propsData: propsData }).$mount();
return vm.$el.textContent;
};

module.exports = {
getRenderedText: getRenderedText
getRenderedText
};
40 changes: 20 additions & 20 deletions frontend/tests/tests/test_analytics.js
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
var gamodule = require("gamodule");

window.apidata = {
base_url: "/",
prefix: "/"
base_url: "/",
prefix: "/"
};

QUnit.module("Google Analytics");
QUnit.test("test without analytics", function (assert) {
var result=[];
window.ga = function(cmd, id, auto) {
result[0] = [cmd, id, auto];
};
window.apidata.analytics = undefined;
var ga = gamodule.init();
assert.notEqual(ga, undefined);
assert.equal(result.length, 0);
var result=[];
window.ga = function(cmd, id, auto) {
result[0] = [cmd, id, auto];
};
window.apidata.analytics = undefined;
var ga = gamodule.init();
assert.notEqual(ga, undefined);
assert.equal(result.length, 0);
});

QUnit.test("test with analytics", function (assert) {
var result=[];
window.ga = function(cmd, id, auto) {
result[0] = [cmd, id, auto];
};
window.apidata.analytics = {"tracking_id": "X"};
var ga = gamodule.init();
assert.notEqual(ga, undefined);
assert.equal(result[0][0], "create");
assert.equal(result[0][1], "X");
assert.equal(result[0][2], "auto");
var result=[];
window.ga = function(cmd, id, auto) {
result[0] = [cmd, id, auto];
};
window.apidata.analytics = {"tracking_id": "X"};
var ga = gamodule.init();
assert.notEqual(ga, undefined);
assert.equal(result[0][0], "create");
assert.equal(result[0][1], "X");
assert.equal(result[0][2], "auto");
});
2 changes: 1 addition & 1 deletion frontend/tests/tests/test_urlutils.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ var urlutils = require("urlutils");

QUnit.module("URL Utils");
QUnit.test("path_join", function (assert) {
assert.equal(urlutils.url_path_join("foo", "bar", "baz"), "foo/bar/baz");
assert.equal(urlutils.url_path_join("foo", "bar", "baz"), "foo/bar/baz");
});
14 changes: 7 additions & 7 deletions frontend/tests/tests/test_utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ var utils = require("utils");

QUnit.module("Utils");
QUnit.test("update", function (assert) {
var o1 = {"foo": "bar"};
var o2 = {"bar": "baz"};
var o1 = {"foo": "bar"};
var o2 = {"bar": "baz"};

utils.update(o1, o2);
utils.update(o1, o2);

assert.deepEqual(o1, {
"foo": "bar",
"bar": "baz"
});
assert.deepEqual(o1, {
"foo": "bar",
"bar": "baz"
});
});
109 changes: 54 additions & 55 deletions frontend/tests/tests/user/mock_jsapi.js
Original file line number Diff line number Diff line change
@@ -1,61 +1,60 @@
var $ = require("jquery");

module.exports = {
Application: {
data: {
"12345": {
image: {
name: "app1",
ui_name: "Application 1",
icon_128: "",
description: "description",
policy: {
allow_home: true,
volume_source: "",
volume_target: "",
volume_mode: ""
},
configurables: [
"resolution"
]
}
},
"67890": {
image: {
name: "app2",
ui_name: "Application 2",
icon_128: "",
description: "description",
policy: {
allow_home: true,
volume_source: "",
volume_target: "",
volume_mode: ""
},
configurables: []
}
}
},
create: function() {
},
delete: function() {
},
retrieve: function(id) {
return $.when(this.data[id]);

},
items: function() {
return $.when(["12345", "67890"], this.data);
Application: {
data: {
"12345": {
image: {
name: "app1",
ui_name: "Application 1",
icon_128: "",
description: "description",
policy: {
allow_home: true,
volume_source: "",
volume_target: "",
volume_mode: ""
},
configurables: [
"resolution"
]
}
},
Container: {
create: function() {
},
delete: function() {
},
retrieve: function() {
},
items: function() {
},
"67890": {
image: {
name: "app2",
ui_name: "Application 2",
icon_128: "",
description: "description",
policy: {
allow_home: true,
volume_source: "",
volume_target: "",
volume_mode: ""
},
configurables: []
}
}
},
create: function() {
},
delete: function() {
},
retrieve: function(id) {
return $.when(this.data[id]);
},
items: function() {
return $.when(["12345", "67890"], this.data);
}
},
Container: {
create: function() {
},
delete: function() {
},
retrieve: function() {
},
items: function() {
}
};
}
};
5 changes: 2 additions & 3 deletions frontend/tests/tests/user/test_application_label.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
var Vue = require("vuejs");
var ApplicationListModel = require("user/ApplicationListModel");
var ApplicationLabel = require("user/vue-components/ApplicationLabel");
var $ = require("jquery");
require("filters");

QUnit.module("user.app_label");
Expand Down Expand Up @@ -31,7 +30,7 @@ QUnit.test("application name", function(assert) {

done();
});
})
});
});
});

Expand Down Expand Up @@ -69,6 +68,6 @@ QUnit.test("rendering stop button", function (assert) {

done();
});
})
});
});
});
Loading