Skip to content

Commit

Permalink
rename component
Browse files Browse the repository at this point in the history
  • Loading branch information
nreese committed Jan 10, 2024
1 parent ba68abd commit ddd179c
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ describe('useBatchedPublishingSubjects', () => {

test('should render once when all state changes are in click handler (react batch)', async () => {
let renderCount = 0;
function UnbatchedComponent() {
function Component() {
const value1 = useStateFromPublishingSubject<number>(subject1);
const value2 = useStateFromPublishingSubject<number>(subject2);
const value3 = useStateFromPublishingSubject<number>(subject3);
Expand All @@ -58,7 +58,7 @@ describe('useBatchedPublishingSubjects', () => {
</>
);
}
render(<UnbatchedComponent />);
render(<Component />);
await waitFor(() => {
expect(screen.getByText('value1: 0, value2: 0, value3: 0, value4: 0, value5: 0, value6: 0')).toBeInTheDocument();
});
Expand All @@ -71,7 +71,7 @@ describe('useBatchedPublishingSubjects', () => {

test('should batch state updates when using useBatchedPublishingSubjects', async () => {
let renderCount = 0;
function BatchedComponent() {
function Component() {
const { value1, value2, value3, value4, value5, value6 } = useBatchedPublishingSubjects({
value1: subject1,
value2: subject2,
Expand All @@ -93,7 +93,7 @@ describe('useBatchedPublishingSubjects', () => {
</>
);
}
render(<BatchedComponent />);
render(<Component />);
await waitFor(() => {
expect(screen.getByText('value1: 0, value2: 0, value3: 0, value4: 0, value5: 0, value6: 0')).toBeInTheDocument();
});
Expand All @@ -106,7 +106,7 @@ describe('useBatchedPublishingSubjects', () => {

test('should render for each state update outside of click handler', async () => {
let renderCount = 0;
function UnbatchedComponent() {
function Component() {
const value1 = useStateFromPublishingSubject<number>(subject1);
const value2 = useStateFromPublishingSubject<number>(subject2);
const value3 = useStateFromPublishingSubject<number>(subject3);
Expand All @@ -126,7 +126,7 @@ describe('useBatchedPublishingSubjects', () => {
</>
);
}
render(<UnbatchedComponent />);
render(<Component />);
await waitFor(() => {
expect(screen.getByText('value1: 0, value2: 0, value3: 0, value4: 0, value5: 0, value6: 0')).toBeInTheDocument();
});
Expand Down

0 comments on commit ddd179c

Please sign in to comment.