Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build(deps-dev): bump @biomejs/biome from 1.8.3 to 1.9.3 #143

Merged
merged 4 commits into from
Oct 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions e2e/settingsHappyPath.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import fs from "node:fs";
import { expect, test } from "@playwright/test";

const rentRegex = /rent/;
const csvRegex = /.csv/;
const jsonRegex = /.json/;

test("should complete the settings happy path", async ({ page, isMobile }) => {
await page.goto("/");

Expand All @@ -24,7 +28,7 @@ test("should complete the settings happy path", async ({ page, isMobile }) => {

await page.getByPlaceholder("Filter...").click();
await page.getByPlaceholder("Filter...").fill("rent");
await page.getByLabel(/rent/).click();
await page.getByLabel(rentRegex).click();

await page.getByText("strict match").click();
await expect(page.getByText("Expenses filtered by: rent")).toBeVisible();
Expand All @@ -51,7 +55,7 @@ test("should complete the settings happy path", async ({ page, isMobile }) => {
const csvDownloadPromise = page.waitForEvent("download");
await page.getByLabel("export budget as csv").click();
const csvDownload = await csvDownloadPromise;
expect(csvDownload.suggestedFilename()).toMatch(/.csv/);
expect(csvDownload.suggestedFilename()).toMatch(csvRegex);
expect(
(await fs.promises.stat(await csvDownload.path())).size,
).toBeGreaterThan(0);
Expand All @@ -70,7 +74,7 @@ test("should complete the settings happy path", async ({ page, isMobile }) => {
throw new Error(downloadError);
}

expect(jsonDownload.suggestedFilename()).toMatch(/.json/);
expect(jsonDownload.suggestedFilename()).toMatch(jsonRegex);
expect(
(await fs.promises.stat(await jsonDownload.path())).size,
).toBeGreaterThan(0);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
},
"devDependencies": {
"@axe-core/playwright": "4.10.0",
"@biomejs/biome": "1.8.3",
"@biomejs/biome": "1.9.3",
"@faker-js/faker": "8.4.1",
"@playwright/test": "1.46.1",
"@simbathesailor/use-what-changed": "2.0.0",
Expand Down
77 changes: 39 additions & 38 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/guitos/context/ConfigContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import {
useContext,
useState,
} from "react";
import { localForageOptionsRepository } from "../infrastructure/localForageOptionsRepository";
import { UserOptions } from "../domain/userOptions";
import type { IntlConfig } from "react-currency-input-field/dist/components/CurrencyInputProps";
import { UserOptions } from "../domain/userOptions";
import { localForageOptionsRepository } from "../infrastructure/localForageOptionsRepository";

interface ConfigContextInterface {
userOptions: UserOptions;
Expand Down
5 changes: 3 additions & 2 deletions src/guitos/domain/uuid.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
const uuidRegex =
/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i;

export class Uuid {
readonly value: string;

Expand All @@ -15,8 +18,6 @@ export class Uuid {
}

private ensureIsValidUuid(id: string): void {
const uuidRegex =
/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i;
if (!uuidRegex.test(id)) {
throw new Error(
`<${this.constructor.name}> does not allow the value <${id}>`,
Expand Down
2 changes: 1 addition & 1 deletion src/guitos/hooks/useDB.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ import { useGeneralContext } from "../context/GeneralContext";
import { Budget } from "../domain/budget";
import type { BudgetItem } from "../domain/budgetItem";
import type { CalculationHistoryItem } from "../domain/calculationHistoryItem";
import { UserOptions } from "../domain/userOptions";
import { Uuid } from "../domain/uuid";
import { localForageBudgetRepository } from "../infrastructure/localForageBudgetRepository";
import { localForageCalcHistRepository } from "../infrastructure/localForageCalcHistRepository";
import { localForageOptionsRepository } from "../infrastructure/localForageOptionsRepository";
import type { Filter, FilteredItem } from "../sections/ChartsPage/ChartsPage";
import type { SearchOption } from "../sections/NavBar/NavBar";
import { UserOptions } from "../domain/userOptions";

const budgetRepository = new localForageBudgetRepository();
const optionsRepository = new localForageOptionsRepository();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import localforage from "localforage";
import { currenciesMap } from "../../lists/currenciesMap";
import { CURRENCY_CODE, LOCALE } from "../domain/userOptions";
import type { UserOptionsRepository } from "../domain/userOptionsRepository";
import type { UserOptions } from "../domain/userOptions";
import type { UserOptionsRepository } from "../domain/userOptionsRepository";

export class localForageOptionsRepository implements UserOptionsRepository {
private readonly optionsDB;
Expand Down
3 changes: 2 additions & 1 deletion src/guitos/sections/Budget/BudgetPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import { useParams } from "react-router-dom";
import { createBudgetNameList } from "../../../utils";
import { useBudget } from "../../context/BudgetContext";
import {
useGeneralContext,
type BudgetNotification,
useGeneralContext,
} from "../../context/GeneralContext";
import type { Budget } from "../../domain/budget";
import { useDB } from "../../hooks/useDB";
Expand Down Expand Up @@ -139,6 +139,7 @@ export function BudgetPage() {
fluid={true}
style={{ zIndex: 1 }}
key={`${budget?.id}-${needReload}`}
// biome-ignore lint/a11y/useSemanticElements: bootstrap is not semantic
role="main"
>
<ToastContainer
Expand Down
6 changes: 3 additions & 3 deletions src/guitos/sections/ErrorModal/ErrorModal.test.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { render, screen } from "@testing-library/react";
import userEvent from "@testing-library/user-event";
import { describe, expect, it, vi } from "vitest";
import { ErrorModal } from "./ErrorModal";
import { CsvErrorMother } from "../../domain/csvError.mother";
import type { CsvError } from "../../domain/csvError";
import { JsonErrorMother } from "../../domain/jsonError.mother";
import { CsvErrorMother } from "../../domain/csvError.mother";
import type { JsonError } from "../../domain/jsonError";
import { JsonErrorMother } from "../../domain/jsonError.mother";
import { ErrorModal } from "./ErrorModal";

const error = "Thrown error";
const jsonErrors: JsonError[] = [JsonErrorMother.error()];
Expand Down
2 changes: 1 addition & 1 deletion src/guitos/sections/ItemForm/ItemFormGroup.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import { describe, expect, it } from "vitest";
import { setBudgetMock } from "../../../setupTests";
import { BudgetMother } from "../../domain/budget.mother";
import { BudgetItemsMother } from "../../domain/budgetItem.mother";
import { ItemFormGroup } from "./ItemFormGroup";
import { UserOptionsMother } from "../../domain/userOptions.mother";
import { ItemFormGroup } from "./ItemFormGroup";

describe("ItemFormGroup", () => {
const ref = createRef<HTMLInputElement>();
Expand Down
Loading