Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release/0.6.0 #152

Merged
merged 5 commits into from
Dec 5, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 0.4;
MARKETING_VERSION = 0.6;
PRODUCT_BUNDLE_IDENTIFIER = kr.codesquad.boostcamp9.MemorialHouse;
PRODUCT_NAME = "$(TARGET_NAME)";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
Expand Down Expand Up @@ -281,7 +281,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 0.4;
MARKETING_VERSION = 0.6;
PRODUCT_BUNDLE_IDENTIFIER = kr.codesquad.boostcamp9.MemorialHouse;
PRODUCT_NAME = "$(TARGET_NAME)";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,23 @@ struct CoreDataBookCoverStorageTests {
id: UUID(),
order: 1,
title: "test1",
imageURL: nil,
imageData: nil,
color: "pink",
category: nil,
favorite: true),
BookCoverDTO(
id: UUID(),
order: 2,
title: "test2",
imageURL: nil,
imageData: nil,
color: "blue",
category: nil,
favorite: false),
BookCoverDTO(
id: UUID(),
order: 3,
title: "test3",
imageURL: nil,
imageData: nil,
color: "beige",
category: nil,
favorite: true)
Expand All @@ -46,7 +46,7 @@ struct CoreDataBookCoverStorageTests {
id: UUID(),
order: 4,
title: "test4",
imageURL: nil,
imageData: nil,
color: "green",
category: nil,
favorite: true)
Expand Down Expand Up @@ -89,7 +89,7 @@ struct CoreDataBookCoverStorageTests {
id: oldBookCover.id,
order: 4,
title: "test4",
imageURL: nil,
imageData: nil,
color: "green",
category: nil,
favorite: true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,7 @@ final class EditBookViewController: UIViewController {
leading: editPageTableView.leadingAnchor, constantLeading: 10,
height: 40
)
buttonStackViewBottomConstraint
= buttonStackView.bottomAnchor.constraint(
buttonStackViewBottomConstraint = buttonStackView.bottomAnchor.constraint(
equalTo: view.safeAreaLayoutGuide.bottomAnchor,
constant: Self.buttonBottomConstant
)
Expand All @@ -221,7 +220,7 @@ final class EditBookViewController: UIViewController {
object: nil
)
// 스크롤이 될 때 키보드 내려가게 설정
editPageTableView.keyboardDismissMode = .onDrag
editPageTableView.keyboardDismissMode = .interactive
}
private func configureBinding() {
let output = viewModel.transform(input: input.eraseToAnyPublisher())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ final class EditPhotoViewController: UIViewController {
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)

drawButton.isHidden = true
configureNavigationAppearance()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,6 @@ public final class HomeViewController: UIViewController {
view.backgroundColor = .baseBackground
collectionView.delegate = self
collectionView.dataSource = self
collectionView.dragDelegate = self
collectionView.dropDelegate = self
collectionView.register(
BookCollectionViewCell.self,
forCellWithReuseIdentifier: BookCollectionViewCell.identifier
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,24 @@ struct HomeViewModelTest {
private var sut: HomeViewModel!
private var cancellables = Set<AnyCancellable>()
private static let bookCovers = [
BookCover(id: UUID(), order: 0, title: "title1", imageURL: nil, color: .blue, category: nil, favorite: false),
BookCover(id: UUID(), order: 1, title: "title2", imageURL: nil, color: .blue, category: nil, favorite: false),
BookCover(id: UUID(), order: 2, title: "title3", imageURL: nil, color: .blue, category: nil, favorite: false)
BookCover(id: UUID(), order: 0, title: "title1", imageData: nil, color: .blue, category: nil, favorite: false),
BookCover(id: UUID(), order: 1, title: "title2", imageData: nil, color: .blue, category: nil, favorite: false),
BookCover(id: UUID(), order: 2, title: "title3", imageData: nil, color: .blue, category: nil, favorite: false)
]

@MainActor
@Test mutating func test홈화면을_시작할때_MemorialHouse_이름과_책커버들을_가져온다() async throws {
// Arrange
let stubFetchMemorialHouseNameUseCase = StubFetchMemorialHouseNameUseCase(dummyMemorialHouseName: "효준")
let stubFetchAllBookCoverUseCase = StubFetchAllBookCoverUseCase()
let stubUpdateBookCoverUseCase = StubUpdateBookCoverUseCase()
let stubDeleteBookCoverUseCase = StubDeleteBookCoverUseCase()
let stubBookCovers = try await stubFetchAllBookCoverUseCase.execute()
sut = HomeViewModel(
fetchMemorialHouseUseCase: stubFetchMemorialHouseNameUseCase,
fetchAllBookCoverUseCase: stubFetchAllBookCoverUseCase,
updateBookCoverUseCase: StubUpdateBookCoverUseCase()
updateBookCoverUseCase: stubUpdateBookCoverUseCase,
deleteBookCoverUseCase: stubDeleteBookCoverUseCase
)

let input = PassthroughSubject<HomeViewModel.Input, Never>()
Expand All @@ -36,13 +39,13 @@ struct HomeViewModelTest {

// Act
receivedOutput.removeAll()
input.send(.viewDidLoad)
input.send(.loadAllBookCovers)
try await Task.sleep(nanoseconds: 500_000_000)

// Assert
#expect(receivedOutput.count == 2)
#expect(receivedOutput.contains(.fetchedMemorialHouseName))
#expect(receivedOutput.contains(.fetchedAllBookCover))
#expect(receivedOutput.contains(.reloadData))
#expect(sut.houseName == "효준")
#expect(sut.bookCovers == stubBookCovers)
}
Expand All @@ -53,7 +56,8 @@ struct HomeViewModelTest {
sut = HomeViewModel(
fetchMemorialHouseUseCase: StubFetchMemorialHouseNameUseCase(dummyMemorialHouseName: "효준"),
fetchAllBookCoverUseCase: StubFetchAllBookCoverUseCase(),
updateBookCoverUseCase: StubUpdateBookCoverUseCase()
updateBookCoverUseCase: StubUpdateBookCoverUseCase(),
deleteBookCoverUseCase: StubDeleteBookCoverUseCase()
)
let input = PassthroughSubject<HomeViewModel.Input, Never>()
var receivedOutput: [HomeViewModel.Output] = []
Expand All @@ -64,7 +68,7 @@ struct HomeViewModelTest {
.store(in: &cancellables)

// Act
input.send(.viewDidLoad)
input.send(.loadAllBookCovers)
try await Task.sleep(nanoseconds: 500_000_000)
receivedOutput.removeAll()

Expand All @@ -73,7 +77,7 @@ struct HomeViewModelTest {

// Assert
#expect(receivedOutput.count == 1)
#expect(receivedOutput.contains(.filteredBooks))
#expect(receivedOutput.contains(.reloadData))
#expect(sut.currentBookCovers.count == 1)
#expect(sut.currentBookCovers.first?.title == "title1")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ struct StubFetchAllBookCoverUseCase: FetchAllBookCoverUseCase {
id: UUID(uuidString: "11111111-1111-1111-1111-111111111111")!,
order: 0,
title: "title1",
imageURL: nil,
imageData: nil,
color: .blue,
category: "친구",
favorite: false
Expand All @@ -17,7 +17,7 @@ struct StubFetchAllBookCoverUseCase: FetchAllBookCoverUseCase {
id: UUID(uuidString: "22222222-2222-2222-2222-222222222222")!,
order: 1,
title: "title2",
imageURL: nil,
imageData: nil,
color: .blue,
category: "가족",
favorite: false
Expand All @@ -26,7 +26,7 @@ struct StubFetchAllBookCoverUseCase: FetchAllBookCoverUseCase {
id: UUID(uuidString: "33333333-3333-3333-3333-333333333333")!,
order: 2,
title: "title3",
imageURL: nil,
imageData: nil,
color: .green,
category: "전체",
favorite: false
Expand All @@ -38,3 +38,7 @@ struct StubFetchAllBookCoverUseCase: FetchAllBookCoverUseCase {
struct StubUpdateBookCoverUseCase: UpdateBookCoverUseCase {
func execute(id: UUID, with bookCover: BookCover) async throws { }
}

struct StubDeleteBookCoverUseCase: DeleteBookCoverUseCase {
func execute(id: UUID) async throws { }
}
Loading