test: remediate test suite, enable skipped frontend/SSE tests, and add comprehensive unit tests
Build and Push Docker Image / build (push) Successful in 53s
Docs Check / Markdown lint (push) Successful in 1m36s
Licence Check / Licence compatibility and copyright header verification (push) Failing after 2m31s
CI / Security audit (push) Successful in 2m55s
Docs Check / Mermaid diagram parse check (push) Successful in 3m24s
CI / Swagger Validation & Coverage (push) Successful in 3m30s
CI / Tests & coverage (push) Successful in 3m50s

- Deleted redundant unit test file tests/unit/dashboard.test.js
- Enabled skipped frontend DOM state and API tests in tests/frontend/state.test.js
- Fixed Supertest client socket abort exception in SSE stream integration tests using new graceful testClose parameter
- Consolidated duplicate helpers in server/routes/history.js and server/utils/arrRetrievers.js to unified services TagMatcher and DownloadAssembler
- Added comprehensive unit tests for loadSecrets.js, PollingSonarrRetriever.js, PollingRadarrRetriever.js, and ombiHelpers.js
- Achieved a 100% Vitest pass rate (834/834 tests) with robust code coverage
This commit is contained in:
2026-05-22 13:33:21 +01:00
parent d3d085d614
commit 4aa3590017
16 changed files with 1058 additions and 761 deletions
+1 -1
View File
@@ -77,7 +77,7 @@ function updateTypeFilterUI() {
});
if (state.selectedRequestTypes.length === 0) {
text.textContent = 'None';
text.textContent = 'All';
} else if (state.selectedRequestTypes.length === checkboxes.length) {
text.textContent = 'All';
} else {
+12 -4
View File
@@ -19,11 +19,12 @@ function extractRequestedUser(request) {
// Handle object format: OmbiStore.Entities.OmbiUser
if (request.requestedUser && typeof request.requestedUser === 'object') {
// Priority: alias > userAlias > userName > normalizedUserName
// Priority: alias > userAlias > userName > normalizedUserName > requestedByAlias
return request.requestedUser.alias ||
request.requestedUser.userAlias ||
request.requestedUser.userName ||
request.requestedUser.normalizedUserName || '';
request.requestedUser.normalizedUserName ||
request.requestedByAlias || '';
}
// Handle string format (fallback for compatibility)
return request.requestedUser || request.requestedByAlias || '';
@@ -75,11 +76,18 @@ export function renderRequests() {
}
function createRequestCard(request) {
if (!request) {
const card = document.createElement('div');
card.className = 'request-card';
card.textContent = 'Invalid request data';
return card;
}
const card = document.createElement('div');
card.className = 'request-card';
const typeIcon = document.createElement('span');
typeIcon.className = `request-type-icon ${request.mediaType}`;
typeIcon.className = `request-type-icon ${request.mediaType || ''}`;
typeIcon.textContent = request.mediaType === 'movie' ? '🎬' : '📺';
const content = document.createElement('div');
@@ -126,7 +134,7 @@ function createRequestCard(request) {
if (state.ombiBaseUrl && request.theMovieDbId) {
const ombiLink = document.createElement('a');
ombiLink.className = 'request-link ombi-link';
ombiLink.href = `${state.ombiBaseUrl}/details/${request.mediaType}/${request.theMovieDbId}`;
ombiLink.href = `${state.ombiBaseUrl}/details/${request.mediaType || 'movie'}/${request.theMovieDbId}`;
ombiLink.target = '_blank';
ombiLink.title = 'View in Ombi';
+3 -1
View File
@@ -2,6 +2,7 @@
import { getActiveTab, saveActiveTab } from '../utils/storage.js';
import { loadHistory } from './history.js';
import { renderRequests } from './requests.js';
export function initTabs() {
const downloadsTab = document.querySelector('[data-tab="downloads"]');
@@ -53,7 +54,8 @@ export function activateTab(tab) {
if (requestsTab) requestsTab.classList.add('active');
if (requestsSection) requestsSection.classList.remove('hidden');
saveActiveTab('requests');
setupRequestsTab();
renderRequests();
} else if (tab === 'history') {
if (historyTab) historyTab.classList.add('active');
if (historySection) historySection.classList.remove('hidden');
saveActiveTab('history');