Merge branch 'main' into renovate/docker-setup-buildx-action-3.x
Build image / build (pull_request) Failing after 5m13s Details

This commit is contained in:
bizcochito 2024-12-01 17:27:22 +00:00
commit 3883d21e86
8 changed files with 8 additions and 1980 deletions

View File

@ -1 +1,2 @@
node_modules
node_modules/
dist/

View File

@ -1,18 +0,0 @@
module.exports = {
root: true,
env: { browser: true, es2020: true },
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:react-hooks/recommended",
],
ignorePatterns: ["dist", ".eslintrc.cjs"],
parser: "@typescript-eslint/parser",
plugins: ["react-refresh"],
rules: {
"react-refresh/only-export-components": [
"warn",
{ allowConstantExport: true },
],
},
};

View File

@ -1,3 +0,0 @@
import { GlobalRegistrator } from "@happy-dom/global-registrator";
GlobalRegistrator.register();

1929
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -14,9 +14,6 @@
"vite": "^6.0.0"
},
"devDependencies": {
"@happy-dom/global-registrator": "^15.0.0",
"@testing-library/jest-dom": "^6.4.2",
"@testing-library/react": "^16.0.0",
"@types/react": "^18.2.43",
"@types/react-dom": "^18.2.17",
"@vitejs/plugin-react-swc": "^3.5.0"

View File

View File

@ -1,5 +1,4 @@
import { useState } from "react";
import "./App.css";
import ImageModerator from "./components/ImageModerator/ImageModerator";
import Login from "./components/Login/Login";

View File

@ -1,31 +0,0 @@
import { render, screen } from "@testing-library/react";
import { expect, it } from "bun:test";
import React from "react";
import ImageModerator, {
ImageModeratorProps,
} from "../../src/components/ImageModerator/ImageModerator";
const properties: ImageModeratorProps = {
acceptLabel: "Accept",
discardLabel: "Discard",
};
it("should render into the document", () => {
render(<ImageModerator {...properties} />);
});
it("should show a new image when accept button is clicked", () => {
const acceptButton = screen.getByText(properties.acceptLabel);
const imgElement = screen.getByRole("img");
const imgElementSrcBefore = imgElement.getAttribute("src");
acceptButton.click();
expect(imgElement.getAttribute("src")).not.toEqual(imgElementSrcBefore);
});
it("should show a new image when discard button is clicked", () => {
const discardButton = screen.getByText(properties.discardLabel);
const imgElement = screen.getByRole("img");
const imgElementSrcBefore = imgElement.getAttribute("src");
discardButton.click();
expect(imgElement.getAttribute("src")).not.toEqual(imgElementSrcBefore);
});