PHP 8.2.30
Preview: helper-stub.ts Size: 1.75 KB
/proc/thread-self/root/home/byroehnu/.trash/node_modules11/adminjs/spec/backend/helpers/helper-stub.ts

import sinon from 'sinon'

import ViewHelpers from '../../../src/backend/utils/view-helpers/view-helpers.js'

export const expectedResult = {
  recordActionUrl: '#recordActionUrl',
  resourceActionUrl: '#resourceActionUrl',
  bulkActionUrl: '#bulkActionUrl',
  loginUrl: 'loginUrl',
  logoutUrl: 'logoutUrl',
  rootUrl: 'admin',
  assetPath: 'assetPath',
  resourceUrl: 'resourceUrl',
  dashboardUrl: 'dashboardUrl',
  pageUrl: 'pageUrl',
  editUrl: 'editUrl',
  showUrl: 'showUrl',
  deleteUrl: 'deleteUrl',
  newUrl: 'newUrl',
  listUrl: 'listUrl',
  bulkDeleteUrl: 'bulkDeleteUrl',
}

export default (): ViewHelpers => (
  {
    options: {
      loginPath: expectedResult.loginUrl,
      logoutPath: expectedResult.logoutUrl,
      rootPath: expectedResult.rootUrl,
    },
    recordActionUrl: sinon.stub().returns(expectedResult.recordActionUrl),
    resourceActionUrl: sinon.stub().returns(expectedResult.resourceActionUrl),
    bulkActionUrl: sinon.stub().returns(expectedResult.bulkActionUrl),
    urlBuilder: sinon.stub(),
    loginUrl: sinon.stub().returns(expectedResult.loginUrl),
    logoutUrl: sinon.stub().returns(expectedResult.logoutUrl),
    assetPath: sinon.stub().returns(expectedResult.assetPath),
    resourceUrl: sinon.stub().returns(expectedResult.resourceUrl),
    dashboardUrl: sinon.stub().returns(expectedResult.dashboardUrl),
    pageUrl: sinon.stub().returns(expectedResult.pageUrl),
    editUrl: sinon.stub().returns(expectedResult.editUrl),
    showUrl: sinon.stub().returns(expectedResult.showUrl),
    deleteUrl: sinon.stub().returns(expectedResult.deleteUrl),
    newUrl: sinon.stub().returns(expectedResult.newUrl),
    listUrl: sinon.stub().returns(expectedResult.listUrl),
    bulkDeleteUrl: sinon.stub().returns(expectedResult.bulkDeleteUrl),
  }
)

Directory Contents

Dirs: 0 × Files: 2

Name Size Perms Modified Actions
1.75 KB lrw-r--r-- 2026-02-28 00:32:22
Edit Download
2.51 KB lrw-r--r-- 2026-02-28 00:32:42
Edit Download

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