Skip to content

Commit

Permalink
build(deps-dev): bump @biomejs/biome from 1.8.3 to 1.9.3 (#143)
Browse files Browse the repository at this point in the history
* build(deps-dev): bump @biomejs/biome from 1.8.3 to 1.9.3

Bumps [@biomejs/biome](https://github.com/biomejs/biome/tree/HEAD/packages/@biomejs/biome) from 1.8.3 to 1.9.3.
- [Release notes](https://github.com/biomejs/biome/releases)
- [Changelog](https://github.com/biomejs/biome/blob/main/CHANGELOG.md)
- [Commits](https://github.com/biomejs/biome/commits/cli/v1.9.3/packages/@biomejs/biome)

---
updated-dependencies:
- dependency-name: "@biomejs/biome"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

* style: order imports

Signed-off-by: rare-magma <[email protected]>

* refactor: declare regex on top level

Signed-off-by: rare-magma <[email protected]>

* style: fix lint warnings

Signed-off-by: rare-magma <[email protected]>

---------

Signed-off-by: dependabot[bot] <[email protected]>
Signed-off-by: rare-magma <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: rare-magma <[email protected]>
  • Loading branch information
dependabot[bot] and rare-magma authored Oct 2, 2024
1 parent ca0df7e commit 1ea0d34
Show file tree
Hide file tree
Showing 9 changed files with 113 additions and 103 deletions.
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
76 changes: 38 additions & 38 deletions pnpm-lock.yaml

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

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
1 change: 1 addition & 0 deletions src/guitos/sections/Budget/BudgetPage.tsx
Original file line number Diff line number Diff line change
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
106 changes: 52 additions & 54 deletions src/guitos/sections/LandingPage/LandingPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,64 +27,62 @@ export function LandingPage({
{loadingFromDB && <Loading />}

{showLandingPage && (
<>
<Container className="position-absolute top-50 start-50 translate-middle">
<Row className="justify-content-center align-content-center">
<h1
className={`${titleWidth} align-self-center justify-content-center text-center pb-5 balanced`}
<Container className="position-absolute top-50 start-50 translate-middle">
<Row className="justify-content-center align-content-center">
<h1
className={`${titleWidth} align-self-center justify-content-center text-center pb-5 balanced`}
>
<p>
Figure out where your money went, plan ahead of time and analyze
past expenditures.
</p>
</h1>
</Row>
<Row className="justify-content-center align-content-center">
<Stack gap={3}>
<Button
className={`${buttonWidth} align-self-center text-nowrap`}
aria-label="new budget"
variant="outline-success"
onClick={createBudget}
>
get started
</Button>
<Form.Group
className={`${buttonWidth} align-self-center text-nowrap`}
controlId="import"
>
<p>
Figure out where your money went, plan ahead of time and
analyze past expenditures.
</p>
</h1>
</Row>
<Row className="justify-content-center align-content-center">
<Stack gap={3}>
<Button
className={`${buttonWidth} align-self-center text-nowrap`}
aria-label="new budget"
variant="outline-success"
onClick={createBudget}
>
get started
</Button>
<Form.Group
className={`${buttonWidth} align-self-center text-nowrap`}
controlId="import"
>
<Button
className="w-100"
aria-label="import budget"
variant="outline-primary"
onClick={() => inputRef.current?.click()}
>
import
</Button>
<Form.Control
type="file"
data-testid="import-form-control-landing-page"
multiple={true}
ref={inputRef}
onChange={(e: React.ChangeEvent<HTMLInputElement>) =>
handleImport(e)
}
style={{ display: "none" }}
/>
</Form.Group>
<Button
className={`${buttonWidth} align-self-center text-nowrap`}
aria-label="open instructions in new tab"
variant="outline-info"
href="https://github.com/rare-magma/guitos#getting-started"
target="_blank"
className="w-100"
aria-label="import budget"
variant="outline-primary"
onClick={() => inputRef.current?.click()}
>
help
import
</Button>
</Stack>
</Row>
</Container>
</>
<Form.Control
type="file"
data-testid="import-form-control-landing-page"
multiple={true}
ref={inputRef}
onChange={(e: React.ChangeEvent<HTMLInputElement>) =>
handleImport(e)
}
style={{ display: "none" }}
/>
</Form.Group>
<Button
className={`${buttonWidth} align-self-center text-nowrap`}
aria-label="open instructions in new tab"
variant="outline-info"
href="https://github.com/rare-magma/guitos#getting-started"
target="_blank"
>
help
</Button>
</Stack>
</Row>
</Container>
)}
</>
);
Expand Down
2 changes: 1 addition & 1 deletion src/guitos/sections/NavBar/NavBar.css
Original file line number Diff line number Diff line change
Expand Up @@ -102,4 +102,4 @@ input[type="text"]::placeholder {

.form-control.rbt-input-main {
background: var(--lightbgcolor);
}
}
13 changes: 9 additions & 4 deletions src/guitos/sections/NavBar/NavBar.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ import {
import { BudgetMother } from "../../domain/budget.mother";
import { NavBar } from "./NavBar";

const changelogRegex = /open guitos changelog/i;
const importRegex = /import budget/i;
const exportCsvRegex = /export budget as csv/i;
const exportJsonRegex = /export budget as json/i;

describe("NavBar", () => {
const windowSpy = vi.spyOn(window, "open");

Expand Down Expand Up @@ -86,17 +91,17 @@ describe("NavBar", () => {
await userEvent.type(screen.getByTestId("header"), "o");
expect(
screen.getByRole("button", {
name: /import budget/i,
name: importRegex,
}),
).toBeInTheDocument();
expect(
screen.getByRole("button", {
name: /export budget as csv/i,
name: exportCsvRegex,
}),
).toBeInTheDocument();
expect(
screen.getByRole("button", {
name: /export budget as json/i,
name: exportJsonRegex,
}),
).toBeInTheDocument();

Expand All @@ -110,7 +115,7 @@ describe("NavBar", () => {
await userEvent.type(screen.getByTestId("header"), "t");
expect(
screen.getByRole("link", {
name: /open guitos changelog/i,
name: changelogRegex,
}),
).toBeInTheDocument();
});
Expand Down
1 change: 1 addition & 0 deletions src/guitos/sections/NavBar/NavBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ export function NavBar() {
<Container
fluid={true}
className="flex-row"
// biome-ignore lint/a11y/useSemanticElements: bootstrap classes
role="heading"
aria-level={1}
>
Expand Down

0 comments on commit 1ea0d34

Please sign in to comment.