Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
jkone27 committed Dec 9, 2024
1 parent 1de6d99 commit 629004c
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 29 deletions.
34 changes: 34 additions & 0 deletions package-lock.json

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

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@
"react-dom": "^18.3.1"
},
"devDependencies": {
"@babel/plugin-transform-modules-commonjs": "^7.26.3",
"@eslint/js": "^9.15.0",
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^14.5.2",
"@types/react": "^18.3.12",
"@types/react-dom": "^18.3.1",
"@vitejs/plugin-react": "^4.3.4",
Expand Down
4 changes: 2 additions & 2 deletions src/App.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@

<ItemGroup>
<Compile Include="Components.fs" />
<Compile Include="App.fs" />
<Compile Include="Components.test.fs" />
<Compile Include="Counter.test.fs" />
<Compile Include="App.fs" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Fable.Jester" Version="0.33.0" />
<PackageReference Include="Feliz" Version="2.9.0" />
<PackageReference Include="Feliz.Router" Version="4.0.0" />
<PackageReference Include="Fable.ReactTestingLibrary" Version="0.33.0" />
Expand Down
6 changes: 3 additions & 3 deletions src/Components.test.fs
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ open Fable.Jester
open Feliz

// Import the main app component
open App.Components
open App

Jest.describe("Counter component", fun () ->
Jest.test("should render initial count", fun () ->
RTL.render(Counter())
RTL.render(Components.Counter())
let countElement = RTL.screen.getByText("count is 0")
Jest.expect(countElement).toBeInTheDocument()
)

Jest.test("should increment count on button click", fun () ->
RTL.render(Counter())
RTL.render(Components.Counter())
let buttonElement = RTL.screen.getByText("count is 0")
RTL.fireEvent.click(buttonElement)
let updatedButtonElement = RTL.screen.getByText("count is 1")
Expand Down
24 changes: 0 additions & 24 deletions src/Counter.test.fs

This file was deleted.

0 comments on commit 629004c

Please sign in to comment.