Skip to content
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
24 changes: 13 additions & 11 deletions src/screens/HomeScreen/Home.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,6 @@ export default function Home({ profile, onClick }) {
title="내 정보 확인하러가기"
onClick={onClick}
/>

<LinkField
url="/apartment/riverside"
title="거주하고 싶은 아파트 둘러보기"
onClick={onClick}
/>
</>
);
}
Expand All @@ -31,11 +25,19 @@ export default function Home({ profile, onClick }) {
<h2>꿈꾸는 삶을 살기 위해 얼마나 많은 돈을 더 벌어야 될까요?</h2>
{
profile?.isNew && (
<LinkField
url="/profile/new"
title="내 정보 입력하러가기"
onClick={onClick}
/>
<>
<LinkField
url="/profile/new"
title="내 정보 입력하러가기"
onClick={onClick}
/>

<LinkField
url="/apartment/riverside"
title="거주하고 싶은 아파트 둘러보기"
onClick={onClick}
/>
</>
)
}
</div>
Expand Down
20 changes: 10 additions & 10 deletions src/screens/HomeScreen/Home.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,16 @@ describe('Home', () => {

expect(handleClick).toBeCalledTimes(1);
});

it('calls handleClick upon clicking check apartments', () => {
renderHome();

fireEvent.click(screen.getByRole('link', {
name: '거주하고 싶은 아파트 둘러보기',
}));

expect(handleClick).toBeCalledTimes(1);
});
});

context('with profile', () => {
Expand All @@ -65,15 +75,5 @@ describe('Home', () => {

expect(handleClick).toBeCalledTimes(1);
});

it('calls handleClick upon clicking check apartments', () => {
renderHome();

fireEvent.click(screen.getByRole('link', {
name: '거주하고 싶은 아파트 둘러보기',
}));

expect(handleClick).toBeCalledTimes(1);
});
});
});