You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

40 line
867 B

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