chore: prune unused files

This commit is contained in:
Alie 2024-12-01 18:25:52 +01:00
parent 3843c90ffa
commit ffa7d8012e
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);
});