wrap-spec-actions.js 839 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. import { execute } from "corePlugins/auth/spec-wrap-actions"
  2. describe("spec plugin - actions", function(){
  3. describe("execute", function(){
  4. xit("should add `securities` to the oriAction call", function(){
  5. // Given
  6. const system = {
  7. authSelectors: {
  8. authorized: jest.fn().mockImplementation(() => ({
  9. some: "security"
  10. }))
  11. }
  12. }
  13. const oriExecute = jest.fn()
  14. // When
  15. let executeFn = execute(oriExecute, system)
  16. executeFn({})
  17. // Then
  18. expect(oriExecute.mock.calls.length).toEqual(1)
  19. expect(oriExecute.mock.calls[0][0]).toEqual({
  20. extras: {
  21. security: {
  22. some: "security"
  23. }
  24. },
  25. method: undefined,
  26. path: undefined,
  27. operation: undefined
  28. })
  29. })
  30. })
  31. })