PHP 8.2.30
Preview: view-helpers.spec.ts Size: 783 B
//proc/thread-self/root/home/byroehnu/.trash/node_modules11/adminjs/src/backend/utils/view-helpers/view-helpers.spec.ts

import { expect } from 'chai'

import ViewHelpers from './view-helpers.js'

describe('ViewHelpers', function () {
  describe('#urlBuilder', function () {
    it('returns joined path for default rootUrl', function () {
      const h = new ViewHelpers({})
      expect(h.urlBuilder(['my', 'path'])).to.equal('/admin/my/path')
    })

    it('returns correct url when user gives admin root path not starting with /', function () {
      const h = new ViewHelpers({ options: { rootPath: 'admin' } })
      expect(h.urlBuilder(['my', 'path'])).to.equal('/admin/my/path')
    })

    it('returns correct url for rootPath set to /', function () {
      const h = new ViewHelpers({ options: { rootPath: '/' } })
      expect(h.urlBuilder(['my', 'path'])).to.equal('/my/path')
    })
  })
})

Directory Contents

Dirs: 0 × Files: 3

Name Size Perms Modified Actions
34 B lrw-r--r-- 2026-02-28 00:32:28
Edit Download
783 B lrw-r--r-- 2026-02-28 00:32:46
Edit Download
7.82 KB lrw-r--r-- 2026-02-28 00:32:46
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).