From 7fd62cb802c0f7cb58737e6e63f869f54fed2eff Mon Sep 17 00:00:00 2001 From: Simon Ihmig Date: Sat, 7 Sep 2024 23:47:21 +0200 Subject: [PATCH 1/5] Cleanup unneeded test context types --- .../components/responsive-image-test.gts | 69 ++++++++----------- ...ponsive-image-cloudinary-provider-test.gts | 22 +++--- .../responsive-image-imgix-provider-test.gts | 16 ++--- .../helpers/responsive-image-resolve-test.gts | 11 +-- 4 files changed, 45 insertions(+), 73 deletions(-) diff --git a/apps/ember-test-app/tests/integration/components/responsive-image-test.gts b/apps/ember-test-app/tests/integration/components/responsive-image-test.gts index 4e6244574..dbb39da13 100644 --- a/apps/ember-test-app/tests/integration/components/responsive-image-test.gts +++ b/apps/ember-test-app/tests/integration/components/responsive-image-test.gts @@ -14,15 +14,6 @@ import smallImage from "ember-test-app/images/tests/image.jpg?w=10;25&format=ori import type { RenderingTestContext } from "@ember/test-helpers"; import { env } from "@responsive-image/core"; -interface TestContext extends RenderingTestContext { - cacheBreaker: () => string; - testImage: ImageData; - testImageLqipInline: ImageData; - testImageLqipColor: ImageData; - testImageLqipBlurhash: ImageData; - smallImage: ImageData; -} - const cacheBreaker = () => new Date().getTime() + "#" + Math.random(); module("Integration: Responsive Image Component", function (hooks) { @@ -31,7 +22,7 @@ module("Integration: Responsive Image Component", function (hooks) { module("source from local files", function () { module("responsive layout", function () { test("it has responsive layout by default", async function (assert) { - await render( + await render( , ); @@ -40,7 +31,7 @@ module("Integration: Responsive Image Component", function (hooks) { }); test("it renders width and height attributes", async function (this: RenderingTestContext, assert) { - await render( + await render( , ); @@ -60,7 +51,7 @@ module("Integration: Responsive Image Component", function (hooks) { }); test("it renders the correct sourceset with width descriptors", async function (assert) { - await render( + await render( , ); @@ -124,7 +115,7 @@ module("Integration: Responsive Image Component", function (hooks) { new RegExp("/images/image-50w(-\\w+)?.avif 50w"), ); - await render( + await render( , ); // png @@ -173,28 +164,28 @@ module("Integration: Responsive Image Component", function (hooks) { // Blocked on https://github.com/embroider-build/ember-auto-import/issues/503 skip("it renders the fallback src next to needed display size", async function (assert) { env.physicalWidth = 45; - await render( + await render( , ); assert .dom("img") .hasAttribute("src", new RegExp("/images/image-50w(-\\w+)?.jpg")); env.physicalWidth = 51; - await render( + await render( , ); assert .dom("img") .hasAttribute("src", new RegExp("/images/image-100w(-\\w+)?.jpg")); env.physicalWidth = 9; - await render( + await render( , ); assert .dom("img") .hasAttribute("src", new RegExp("/images/image-10w(-\\w+)?.jpg")); env.physicalWidth = 11; - await render( + await render( , ); assert @@ -203,7 +194,7 @@ module("Integration: Responsive Image Component", function (hooks) { }); test("it renders a given size as sizes", async function (assert) { - await render( + await render( , @@ -217,7 +208,7 @@ module("Integration: Responsive Image Component", function (hooks) { }); test("it renders with given sizes", async function (assert) { - await render( + await render(