feat(mypage): 최신 공지 배열과 제목 롤링을 적용한다

This commit is contained in:
Yu Sung
2026-10-28 17:15:38 +09:00
parent 8c08861b34
commit 42bdfb8779
9 changed files with 462 additions and 43 deletions
@@ -41,7 +41,7 @@ final class UserRepository {
}
final class NoticeRepository {
func getLatestNotice() -> AnyPublisher<Response, MoyaError> {
func getLatestNotices() -> AnyPublisher<Response, MoyaError> {
let subject = PassthroughSubject<Response, MoyaError>()
AuthExitIO.noticeSubjects.append(subject)
return subject.eraseToAnyPublisher()
@@ -337,7 +337,7 @@ struct AuthContentSettingsExitCheck {
expect(viewModel.isShowPopup, "Hidden-panel cancel changed unrelated toast")
viewModel.presentAuthContentSettings()
expect(viewModel.isShowAuthContentSettings, "Hidden-panel cancel discarded receipt")
viewModel.getLatestNotice()
viewModel.getLatestNotices()
var cancellationOnMain: Bool?
let observation = viewModel.$isShowAuthContentSettings.dropFirst().sink { shown in
if !shown { cancellationOnMain = Thread.isMainThread }
@@ -350,8 +350,9 @@ struct AuthContentSettingsExitCheck {
expect(dispatched.wait(timeout: .now() + 2) == .success, "Background cancellation did not return")
wait("background cancellation") { cancellationOnMain != nil }
expect(cancellationOnMain == true, "Background cancellation mutated panel off main")
send(AuthExitIO.noticeSubjects[0], json: #"{"success":true,"data":{"title":"Synthetic notice","content":"Synthetic content","date":"synthetic-date"}}"#)
expect(viewModel.latestNotice?.title == "Synthetic notice", "Cancellation removed unrelated shared subscriptions")
send(AuthExitIO.noticeSubjects[0], json: #"{"success":true,"data":[{"title":"Synthetic notice","content":"Synthetic content","date":"synthetic-date"}]}"#)
wait("unrelated notice response") { viewModel.latestNotices.first?.title == "Synthetic notice" }
expect(viewModel.latestNotices.count == 1, "Cancellation removed unrelated shared subscriptions")
viewModel.submitPendingAuthVerification()
drainMainQueue()
expectNoEffects(posts: 0, "background exit")