UI 복잡 버전 234 RED→GREEN 완료(docs/UI_USECASES.md §A~§J): 라이브 테마 전환(DynamicResource 전환+ThemeResolver+HighContrast 테마, 재시작 없음), 디자인 토큰 체계·WCAG 대비 결함 5건 수정, 설정창 카테고리 내비/검색 재구성+AppConfig 40여 속성, 다운로드 관리자(속도/ETA/세그먼트맵/전체 일시정지-이어받기/CSV 내보내기/예약 게이트/중복 확인), 라이브러리·아카이브·작업공간·재생목록·즐겨찾기 편집 뷰, 접근성(자동화 속성 30여 개·커스텀 피어·docs/ACCESSIBILITY.md), 인터랙션(휠 클릭 새 탭·XButton 탐색·F12·영역 캡처·프로필 전환), 상태/알림(토스트·알림센터·온보딩·CrashReportDialog). 보강 테스트 35건+실창 E2E 4건(StaDispatcher 기반 — 프록시 설정이 기시작 핸들러를 건드리는 크래시 실결함 수정 포함) — 453/453 GREEN. 이전 미커밋 작업(CI 워크플로·Mdns·QueueHub·UpdateChecker·AGENTS/CLAUDE·빌드 스크립트) 일괄 포함
This commit is contained in:
parent
5a0ce730b2
commit
17f2f91152
88 changed files with 9463 additions and 1127 deletions
90
VideoDownloader.Tests/Server/QueueHubE2ETests.cs
Normal file
90
VideoDownloader.Tests/Server/QueueHubE2ETests.cs
Normal file
|
|
@ -0,0 +1,90 @@
|
|||
using System.Net.Http;
|
||||
using Microsoft.AspNetCore.SignalR.Client;
|
||||
using VideoDownloader.Server;
|
||||
|
||||
namespace VideoDownloader.Tests.Server;
|
||||
|
||||
/// <summary>
|
||||
/// E2E: SignalR <c>/hubs/queue</c> — MOBILE_PLAN §3 API 설계안의 실시간 큐 푸시.
|
||||
/// 실제 Kestrel 기동 → 허브 접속(쿼리 토큰 인증) → 스냅샷 조회 + 큐 변경 시 서버 푸시 수신.
|
||||
/// </summary>
|
||||
public class QueueHubE2ETests : IDisposable
|
||||
{
|
||||
private readonly string _libDir = Path.Combine(Path.GetTempPath(), $"vd_hub_{Guid.NewGuid():N}");
|
||||
|
||||
public QueueHubE2ETests() => Directory.CreateDirectory(_libDir);
|
||||
|
||||
private sealed class FakeQueue : IQueueAdapter
|
||||
{
|
||||
public List<QueueItemDto> Items { get; } = new();
|
||||
|
||||
public Task<IReadOnlyList<QueueItemDto>> GetItemsAsync() => Task.FromResult<IReadOnlyList<QueueItemDto>>(Items);
|
||||
public Task<string> AddAsync(string url, string? title)
|
||||
{
|
||||
var item = new QueueItemDto(Guid.NewGuid().ToString("N"), title ?? url, url, "대기", 0);
|
||||
Items.Add(item);
|
||||
Changed?.Invoke();
|
||||
return Task.FromResult(item.Id);
|
||||
}
|
||||
public Task PauseAsync(string id) => Task.CompletedTask;
|
||||
public Task ResumeAsync(string id) => Task.CompletedTask;
|
||||
public Task CancelAsync(string id) => Task.CompletedTask;
|
||||
|
||||
public event Action? Changed;
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task 큐허브_스냅샷_조회와_변경시_푸시_E2E()
|
||||
{
|
||||
var queue = new FakeQueue();
|
||||
await using var server = await ServerHost.StartAsync(new ServerOptions
|
||||
{
|
||||
Port = 0,
|
||||
Token = "hub-token-123",
|
||||
LibraryFolder = _libDir,
|
||||
Queue = queue,
|
||||
});
|
||||
|
||||
await using var conn = new HubConnectionBuilder()
|
||||
.WithUrl($"http://127.0.0.1:{server.Port}/hubs/queue?t=hub-token-123")
|
||||
.Build();
|
||||
|
||||
var pushed = new TaskCompletionSource<List<QueueItemDto>>(TaskCreationOptions.RunContinuationsAsynchronously);
|
||||
conn.On<List<QueueItemDto>>("queueUpdated", items => pushed.TrySetResult(items));
|
||||
|
||||
await conn.StartAsync();
|
||||
|
||||
// 1) 허브 메서드로 현재 스냅샷 조회
|
||||
var snapshot = await conn.InvokeAsync<List<QueueItemDto>>("GetQueue");
|
||||
Assert.Empty(snapshot);
|
||||
|
||||
// 2) 큐 변경 → 폴링 없이 서버가 밀어줌 (2초 폴링의 실시간 대체)
|
||||
await queue.AddAsync("https://x.test/push.mp4", "푸시 영상");
|
||||
var items = await pushed.Task.WaitAsync(TimeSpan.FromSeconds(10));
|
||||
Assert.Single(items);
|
||||
Assert.Equal("푸시 영상", items[0].Title);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task 큐허브_잘못된_토큰은_401_거부()
|
||||
{
|
||||
await using var server = await ServerHost.StartAsync(new ServerOptions
|
||||
{
|
||||
Port = 0,
|
||||
Token = "hub-token-123",
|
||||
LibraryFolder = _libDir,
|
||||
Queue = new FakeQueue(),
|
||||
});
|
||||
|
||||
await using var conn = new HubConnectionBuilder()
|
||||
.WithUrl($"http://127.0.0.1:{server.Port}/hubs/queue?t=wrong-token")
|
||||
.Build();
|
||||
|
||||
await Assert.ThrowsAsync<HttpRequestException>(() => conn.StartAsync());
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
try { Directory.Delete(_libDir, recursive: true); } catch (IOException) { }
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue