Skip to content

Commit

Permalink
chore: 튜토리얼 test 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
pkl0912 committed Nov 6, 2024
1 parent fb16c91 commit bc761e9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,5 @@ default Page<Todo> findHistories(Long userId, LocalDate today, Pageable pageable
}

List<Todo> findByType(Type type);
List<Todo> findByTypeAndUserId(Type type, Long userId);
}
Original file line number Diff line number Diff line change
Expand Up @@ -170,17 +170,17 @@ void createTutorialData_Success() {
authService.createTutorialData(newUser.getId());

//then
List<Todo> todays = todoRepository.findByType(Type.TODAY);
List<Todo> backlogs = todoRepository.findByType(Type.BACKLOG);
List<Todo> todays = todoRepository.findByTypeAndUserId(Type.TODAY, newUser.getId());
List<Todo> backlogs = todoRepository.findByTypeAndUserId(Type.BACKLOG, newUser.getId());

assertThat(todays.size()).isEqualTo(1);
assertThat(backlogs).hasSize(4)
.extracting("content","backlogOrder")
.containsExactlyInAnyOrder(
tuple(4, TutorialMessage.BACKLOG_NEW_TODO),
tuple(3, TutorialMessage.BACKLOG_BOOKMARK_DDAY),
tuple(2, TutorialMessage.BACKLOG_DRAG_AND_DROP),
tuple(1, TutorialMessage.BACKLOG_LEFT_SWIPE)
tuple(TutorialMessage.BACKLOG_NEW_TODO, 4),
tuple(TutorialMessage.BACKLOG_BOOKMARK_DDAY, 3),
tuple(TutorialMessage.BACKLOG_DRAG_AND_DROP,2),
tuple(TutorialMessage.BACKLOG_LEFT_SWIPE,1)
);
}
}

0 comments on commit bc761e9

Please sign in to comment.