From 9cf0f2ff42dfa4a454d0604f1c63f42df6694b53 Mon Sep 17 00:00:00 2001 From: Alex Jover Date: Sun, 13 Feb 2022 23:23:39 +0100 Subject: [PATCH] test: fix test --- v-lazy-image/cypress/component/index.spec.js | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/v-lazy-image/cypress/component/index.spec.js b/v-lazy-image/cypress/component/index.spec.js index a8952a6..423357b 100644 --- a/v-lazy-image/cypress/component/index.spec.js +++ b/v-lazy-image/cypress/component/index.spec.js @@ -2,7 +2,7 @@ import { mount } from "@cypress/vue"; import Demo from "../../../playground-vue3/App.vue"; describe("Demo vue 3", () => { - before(() => { + beforeEach(() => { mount(Demo, {}); }); @@ -16,18 +16,27 @@ describe("Demo vue 3", () => { // First should't be loaded, thus don't have a src cy.get(".picture-demo") .should("have.attr", "src") - .and("not.equals", "https://cdn-images-1.medium.com/max/800/1*xjGrvQSXvj72W4zD6IWzfg.jpeg"); + .and( + "not.equals", + "https://cdn-images-1.medium.com/max/800/1*xjGrvQSXvj72W4zD6IWzfg.jpeg" + ); // When scrolling should load cy.get(".picture-demo") .scrollIntoView() .should("have.attr", "src") - .and("equals", "https://cdn-images-1.medium.com/max/800/1*xjGrvQSXvj72W4zD6IWzfg.jpeg"); + .and( + "equals", + "https://cdn-images-1.medium.com/max/800/1*xjGrvQSXvj72W4zD6IWzfg.jpeg" + ); // Same for srcset cy.get(".srcset-demo") .should("have.attr", "src") - .and("equals", "https://cdn-images-1.medium.com/max/800/1*xjGrvQSXvj72W4zD6IWzfg.jpeg"); + .and( + "equals", + "https://cdn-images-1.medium.com/max/800/1*xjGrvQSXvj72W4zD6IWzfg.jpeg" + ); }); it("Loads progressively an image when using src-placeholder", () => {