Currently, I am working on setting up a test within my Angular application. The goal of this test is to click on an element and check if a specific object is displayed. While I believe the code provided below should work, I am aware that the isDisplayed() method is designed for a single element and not multiple elements. I have heard about the .each() function but I am unsure of how to incorporate it in this scenario. Can someone guide me on using .each() with isDisplayed()?
it('should flip cards and check to make sure graph is visible', function(){
var cards = element.all(by.repeater('card in cards'));
var backOfCard = element.all(by.css('#current-status ul li .back canvas'));
expect(browser.getCurrentUrl()).toEqual('http://localhost:8000/app/#/dashboard');
expect(cards.count()).toBe(4);
cards.click().then(function(){
expect(backOfCard.isDisplayed()).toBe([true, true, true, true]);
});
});