Skip to content

Commit

Permalink
fixed syntax error
Browse files Browse the repository at this point in the history
  • Loading branch information
akartavtsev committed Jan 13, 2020
1 parent d1b63cb commit f08857b
Showing 1 changed file with 11 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@
*/

define([
'ko',
'uiRegistry',
'Magento_Ui/js/model/messages'
], function (ko, registry, Constr) {
], function (registry, Constr) {
'use strict';

describe('Magento_Ui/js/model/messages', function () {
Expand Down Expand Up @@ -44,6 +43,7 @@ define([
},
type = [],
returnedObj = ["Message test"];

expect(obj.add(messageObj, type)).toEqual(true);
expect(type).toEqual(returnedObj);
});
Expand All @@ -60,28 +60,29 @@ define([
type = [],
returnedObj = ["Message test case " + messageObj.parameters[0] + ", case " +
messageObj.parameters[1] + " and case " + messageObj.parameters[2]];

expect(obj.add(messageObj, type)).toEqual(true);
expect(type).toEqual(returnedObj);
});
});

describe('check methods: hasMessages, addErrorMessage, getErrorMessages', function () {
var errorMessageText = "Error message test";

it('hasMessages method before adding messages', function () {
expect(obj.hasMessages()).toEqual(false);
});

it('check addErrorMessage method', function () {
var messageObj = {
message: "Error message test"
message: errorMessageText
};

expect(obj.addErrorMessage(messageObj)).toEqual(true);
});

it('check getErrorMessage method', function () {
var errorMessages = ko.observableArray(["Error message test"]);

expect(obj.getErrorMessages()()).toEqual(errorMessages());
expect(obj.getErrorMessages()()).toEqual([errorMessageText]);
});

it('hasMessages method after adding Error messages', function () {
Expand All @@ -98,17 +99,18 @@ define([
});

describe('check methods: hasMessages, addSuccessMessage, getSuccessMessages', function () {
var successMessageText = "Success message test";

it('check addSuccessMessage and getSuccessMessage', function () {
var messageObj = {
message: "Success message test"
message: successMessageText
};

expect(obj.addSuccessMessage(messageObj)).toEqual(true);
});

it('check method getSuccessMessage', function () {
var successMessages = ko.observableArray(["Success message test"]);
expect(obj.getSuccessMessages()()).toEqual(successMessages());
expect(obj.getSuccessMessages()()).toEqual([successMessageText]);
});

it('hasMessages method after adding Success messages', function () {
Expand Down

0 comments on commit f08857b

Please sign in to comment.