Skip to content

Commit

Permalink
test: fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
alexjoverm committed Feb 13, 2022
1 parent 8ab78bd commit 9cf0f2f
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions v-lazy-image/cypress/component/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { mount } from "@cypress/vue";
import Demo from "../../../playground-vue3/App.vue";

describe("Demo vue 3", () => {
before(() => {
beforeEach(() => {
mount(Demo, {});
});

Expand All @@ -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", () => {
Expand Down

0 comments on commit 9cf0f2f

Please sign in to comment.