Skip to content

Commit

Permalink
reproduce accurately
Browse files Browse the repository at this point in the history
  • Loading branch information
JoviDeCroock committed Jul 6, 2023
1 parent b06d371 commit 38635b6
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions packages/preact/test/index.test.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import {
signal,
computed,
useComputed,
useSignalEffect,
Signal,
signal,
} from "@preact/signals";
import { createElement, createRef, render, createContext } from "preact";
import { useContext, useState } from "preact/hooks";
Expand Down Expand Up @@ -431,9 +431,10 @@ describe("@preact/signals", () => {
);
}

const s = signal('baz')
function Test() {
const value = useContext(ctx);
return <p>{value.test}</p>
return <p>{value.test} {s.value}</p>
}

function App() {
Expand All @@ -442,11 +443,11 @@ describe("@preact/signals", () => {

render(<App />, scratch);

expect(scratch.innerHTML).to.equal('<p>foo</p>')
expect(scratch.innerHTML).to.equal('<p>foo baz</p>')
act(() => {
update('bar')
})
expect(scratch.innerHTML).to.equal('<p>bar</p>')
expect(scratch.innerHTML).to.equal('<p>bar baz</p>')
})
})

Expand Down

0 comments on commit 38635b6

Please sign in to comment.