mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-11 03:53:13 +00:00
Fix tests
This commit is contained in:
@@ -17,11 +17,11 @@ define([
|
||||
initialize: function(options) {
|
||||
options = options || {};
|
||||
|
||||
if (! "name" in options) {
|
||||
if (false === "name" in options) {
|
||||
throw "Missing name attribute in error view";
|
||||
}
|
||||
|
||||
if (! "errorTemplate" in options) {
|
||||
if (false === "errorTemplate" in options) {
|
||||
throw "Missing errorTemplate attribute in error view";
|
||||
}
|
||||
|
||||
|
@@ -18,11 +18,11 @@ define([
|
||||
initialize: function(options) {
|
||||
options = options || {};
|
||||
|
||||
if (! "name" in options) {
|
||||
if (false === "name" in options) {
|
||||
throw "Missing name attribute in input view";
|
||||
}
|
||||
|
||||
if (! "errorTemplate" in options) {
|
||||
if (false === "errorTemplate" in options) {
|
||||
throw "Missing errorTemplate attribute in input view";
|
||||
}
|
||||
|
||||
|
@@ -2,9 +2,9 @@ define([
|
||||
'chai',
|
||||
'fixtures',
|
||||
'jquery',
|
||||
'apps/login/home/views/form',
|
||||
'apps/login/home/views/input',
|
||||
'apps/login/home/views/error'
|
||||
'common/forms/views/form',
|
||||
'common/forms/views/input',
|
||||
'common/forms/views/error'
|
||||
], function(
|
||||
chai,
|
||||
fixtures,
|
||||
@@ -65,7 +65,8 @@ define([
|
||||
describe("Input View", function() {
|
||||
it("should initialize error view", function() {
|
||||
var input = new InputView({
|
||||
"name": "test"
|
||||
"name": "test",
|
||||
"errorTemplate": "#field_errors"
|
||||
});
|
||||
expect(input.errorView).to.be.an.instanceof(ErrorView);
|
||||
});
|
||||
@@ -79,8 +80,10 @@ define([
|
||||
};
|
||||
|
||||
var errorView = new ErrorView({
|
||||
"name": "test",
|
||||
"errors": [error],
|
||||
"el" : $(".error-view").first()
|
||||
"el" : $(".error-view").first(),
|
||||
"errorTemplate": "#field_errors"
|
||||
});
|
||||
|
||||
errorView.render();
|
||||
@@ -94,8 +97,10 @@ define([
|
||||
$el.html('previous error here');
|
||||
|
||||
var errorView = new ErrorView({
|
||||
"name": "test",
|
||||
"errors": [],
|
||||
"el" : $el
|
||||
"el" : $el,
|
||||
"errorTemplate": "#field_errors"
|
||||
});
|
||||
|
||||
errorView.render();
|
||||
|
@@ -1,6 +1,6 @@
|
||||
define([
|
||||
'chai',
|
||||
'common/validator'
|
||||
'common/forms/validator'
|
||||
], function(chai, Validator) {
|
||||
var expect = chai.expect;
|
||||
var assert = chai.assert;
|
||||
|
Reference in New Issue
Block a user