REDROOM
PHP 8.2.30
Path:
Logout
Edit File
Size: 2.05 KB
Close
/proc/thread-self/root/home/byroehnu/.trash/node_modules11/adminjs/lib/backend/utils/build-feature/build-feature.spec.js
Text
Base64
/* eslint-disable @typescript-eslint/no-empty-function */ import { expect } from 'chai'; import { mergeResourceOptions } from './build-feature.js'; describe('mergeResourceOptions', function () { it('chaines before hooks', function () { const existingOptions = { actions: { new: { before: function firstBeforeHook() {}, handler: null }, edit: { after: [function firstAfterHook() {}] } } }; const newOptions = { actions: { new: { before: function lastBeforeHook() {}, handler: function lastHandler() {} }, edit: { after: function lastAfterHook() {} }, newAction: { handler: function newHandler() {} } } }; expect(mergeResourceOptions(existingOptions, newOptions)).to.deep.eq({ actions: { new: { before: [existingOptions.actions.new.before, newOptions.actions.new.before], handler: [newOptions.actions.new.handler] }, edit: { after: [existingOptions.actions.edit.after[0], newOptions.actions.edit.after] }, newAction: { handler: [newOptions.actions.newAction.handler] } } }); }); it('chaines properties', function () { const existingOptions = { properties: { password: { isVisible: true, component: 'ala' } } }; const newOptions = { properties: { password2: { isVisible: false, component: 'ela' } } }; expect(mergeResourceOptions(existingOptions, newOptions)).to.deep.eq({ properties: { ...existingOptions.properties, ...newOptions.properties } }); }); it('merges falsey options', function () { const existingOptions = { navigation: { name: 'db' } }; const newOptions = { navigation: false }; expect(mergeResourceOptions(existingOptions, newOptions)).to.deep.eq({ navigation: false }); }); });
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 0 × Files: 3
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
build-feature.js
3.57 KB
lrw-r--r--
2026-02-28 00:31:22
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
build-feature.spec.js
2.05 KB
lrw-r--r--
2026-02-28 00:31:22
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
index.js
35 B
lrw-r--r--
2026-02-28 00:31:42
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).