Forgive me for this seemingly silly question, but I'm having trouble understanding it. I am a newcomer to both testing and JavaScript, so please bear with me.
Here is the test in question:
describe('initialized from copy job functionality', () => {
it('should initialize the constructor based on production selection', () => {
spyOn(MockWizardService, 'loadViewsForWizardSteps').and.returnValue(q.resolve({
templates
}));
controller.Init();
scope.$digest();
expect(controller.templatesToBeDisplayed).toEqual(templatesAll);
});
These are the template arrays being used:
let templates = [
'views/wizards/create_test/sortStep.html',
];
let templatesAll = [
'views/wizards/create_test/general.html',
templates,
'views/wizards/create_test/summary.html'
];
The value of templates
may change, which is why it is structured in that way.
Below is the error message I am encountering:
Expected $[1] = Object({templates: [ 'views/wizards/create_test/sortStep.html' ] }) to equal [ 'views/wizards/create_test/sortStep.html' ].
I realize that I need to modify the structure of templates within templatesAll, but I can't seem to figure out how to do it.