Finalize Journals V3 migration and implement soft delete testing.
- Added 'Test Journal Module Soft Deletes' to the testing page. - Verified 'disable' and 'hide' methods for journal entries. - Ensured all Journals CRUD operations utilize the standardized V3 wrappers. - Documented successful end-to-end testing of the new API patterns.
This commit is contained in:
@@ -118,6 +118,56 @@
|
||||
v3_test_result = result;
|
||||
console.log('V3 Delete (Disable) Nested Result:', result);
|
||||
}
|
||||
|
||||
import { journals_func } from '$lib/ae_journals/ae_journals_functions';
|
||||
|
||||
async function test_journal_module_soft_delete() {
|
||||
console.log('*** test_journal_module_soft_delete() ***');
|
||||
v3_test_result = 'loading...';
|
||||
|
||||
// 1. Create a fresh entry first
|
||||
const new_entry = await journals_func.create_ae_obj__journal_entry({
|
||||
api_cfg: $ae_api,
|
||||
journal_id: 'JGEB-80-92-50',
|
||||
data_kv: {
|
||||
name: 'Soft Delete Test Entry',
|
||||
content: 'Testing disable and hide methods...',
|
||||
account_id_random: 'nqOzejLCDXM'
|
||||
},
|
||||
log_lvl: 1
|
||||
});
|
||||
|
||||
if (!new_entry) {
|
||||
v3_test_result = 'Failed to create test entry';
|
||||
return;
|
||||
}
|
||||
|
||||
const entry_id = new_entry.journal_entry_id_random;
|
||||
console.log('Created test entry:', entry_id);
|
||||
|
||||
// 2. Test 'disable'
|
||||
console.log('Testing DISABLE...');
|
||||
await journals_func.delete_ae_obj_id__journal_entry({
|
||||
api_cfg: $ae_api,
|
||||
journal_entry_id: entry_id,
|
||||
method: 'disable',
|
||||
log_lvl: 1
|
||||
});
|
||||
|
||||
// 3. Test 'hide'
|
||||
console.log('Testing HIDE...');
|
||||
const final_result = await journals_func.delete_ae_obj_id__journal_entry({
|
||||
api_cfg: $ae_api,
|
||||
journal_entry_id: entry_id,
|
||||
method: 'hide',
|
||||
log_lvl: 1
|
||||
});
|
||||
|
||||
v3_test_result = {
|
||||
message: 'Soft delete (disable) and hide tests completed for entry ' + entry_id,
|
||||
last_result: final_result
|
||||
};
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="container h-full mx-auto flex flex-col justify-center items-center p-4 gap-4">
|
||||
@@ -140,6 +190,9 @@
|
||||
<button class="btn variant-filled-error" onclick={test_v3_delete_nested}>
|
||||
Test V3 Delete (Disable) Nested
|
||||
</button>
|
||||
<button class="btn variant-filled-success" onclick={test_journal_module_soft_delete}>
|
||||
Test Journal Module Soft Deletes
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user