REDROOM
PHP 8.2.30
Path:
Logout
Edit File
Size: 2.04 KB
Close
//home/byroehnu/easepay.easetack.com/node_modules/adminjs/src/backend/decorators/resource/utils/get-navigation.spec.ts
Text
Base64
import { expect } from 'chai' import { ResourceOptions } from '../resource-options.interface.js' import { getNavigation, DatabaseData, getIcon } from './get-navigation.js' const databaseName = 'mysql-database' const databaseType = 'MySQL' const defaultDatabase: DatabaseData = { databaseName: () => databaseName, databaseType: () => databaseType, } const mappedIcon = getIcon(databaseType) describe('.getNavigation', () => { let resourceOptions: ResourceOptions beforeEach(() => { resourceOptions = {} }) it('returns parent with icon when no options are given', () => { resourceOptions.navigation = undefined expect(getNavigation(resourceOptions, defaultDatabase)).to.deep.eq({ icon: mappedIcon, name: databaseName, show: true, }) }) it('returns null when options are set to null', () => { resourceOptions.navigation = null expect(getNavigation(resourceOptions, defaultDatabase)).to.be.null }) it('returns show false when options are set to false', () => { resourceOptions.navigation = false expect(getNavigation(resourceOptions, defaultDatabase)).to.deep.eq({ name: null, icon: '', show: false, }) }) it('returns parent with a default icon when options was set as a string', () => { const parentName = 'my navigation name' resourceOptions.navigation = parentName expect(getNavigation(resourceOptions, defaultDatabase)).to.deep.eq({ icon: mappedIcon, name: parentName, show: true, }) }) it('returns empty parent with an icon when this was set in options', () => { const icon = 'Car' resourceOptions.navigation = { icon, name: null } expect(getNavigation(resourceOptions, defaultDatabase)).to.deep.eq({ icon, name: null, show: true, }) }) it('works the same with old parent option', () => { const icon = 'Car' resourceOptions.parent = { icon, name: null } expect(getNavigation(resourceOptions, defaultDatabase)).to.deep.eq({ icon, name: null, show: true, }) }) })
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 0 × Files: 10
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
.htaccess
127 B
lr--r--r--
2026-03-14 01:49:20
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
decorate-actions.ts
1.65 KB
lrw-r--r--
2026-02-28 00:32:04
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
decorate-properties.spec.ts
7.02 KB
lrw-r--r--
2026-02-28 00:32:04
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
decorate-properties.ts
3.68 KB
lrw-r--r--
2026-02-28 00:32:06
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
find-sub-property.ts
1.15 KB
lrw-r--r--
2026-02-28 00:32:14
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
flat-sub-properties.ts
813 B
lrw-r--r--
2026-02-28 00:32:14
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
get-navigation.spec.ts
2.04 KB
lrw-r--r--
2026-02-28 00:32:20
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
get-navigation.ts
1.62 KB
lrw-r--r--
2026-02-28 00:32:20
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
get-property-by-key.ts
1.02 KB
lrw-r--r--
2026-02-28 00:32:20
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
index.ts
236 B
lrw-r--r--
2026-02-28 00:32:28
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).