Skip to content
Open
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
2 changes: 2 additions & 0 deletions scripts/run-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ function formatStatus(status) {
const TESTS = {
'chat-document-search': 'test-chat-document-search.js',
'chat-documents-service-search': 'test-chat-documents-service-search.js',
'custom-field-longtext-ui': 'test-custom-field-longtext-ui.js',
'document-type-restriction': 'test-document-type-restriction.js',
'effective-document-count-cache': 'test-effective-document-count-cache.js',
'failed-reset-all': 'test-failed-reset-all.js',
Expand Down Expand Up @@ -65,6 +66,7 @@ const AREAS = {
ocr: ['ocr-fallback-ai-errors', 'ocr-startup-recovery'],
observability: ['log-level-config', 'log-level-logger'],
processing: [
'custom-field-longtext-ui',
'document-type-restriction',
'ignore-tags-filter',
'effective-document-count-cache',
Expand Down
23 changes: 23 additions & 0 deletions tests/test-custom-field-longtext-ui.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
const assert = require('assert');
const fs = require('fs');
const path = require('path');

function main() {
const settingsTemplate = fs.readFileSync(
path.join(__dirname, '..', 'views', 'settings.ejs'),
'utf8'
);

assert(
settingsTemplate.includes('<option value="longtext">Long Text</option>'),
'Expected the custom field type selector to include Long Text'
);
}

try {
main();
console.log('[PASS] Long Text custom field option is available in settings');
} catch (error) {
console.error('[FAIL] Long Text custom field UI test failed:', error.message);
process.exitCode = 1;
}
1 change: 1 addition & 0 deletions views/settings.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -600,6 +600,7 @@
<div class="col-span-3">
<select id="newFieldType" onchange="toggleCurrencySelect()" class="w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg shadow-sm focus:ring-2 focus:ring-blue-500 focus:border-blue-500 bg-white dark:bg-gray-800 text-gray-900 dark:text-gray-100">
<option value="string">Text</option>
<option value="longtext">Long Text</option>
<option value="float">Number</option>
<option value="integer">Integer</option>
<option value="monetary">Currency</option>
Expand Down