fix(jest): add stub for errActions to prevent unhandled promise rejections #6365 (#6495)

Co-authored-by: Theo Markovic <theodore.markovic@svenskaspel.se>
This commit is contained in:
Theo Markovic
2020-10-15 02:07:49 +02:00
committed by GitHub
parent 3905fadfbe
commit 537ad6d6bf

View File

@@ -72,6 +72,9 @@ describe("auth plugin - actions", () => {
authSelectors: { authSelectors: {
getConfigs: () => ({}) getConfigs: () => ({})
}, },
errActions: {
newAuthErr: () => ({})
},
oas3Selectors: { oas3Selectors: {
selectedServer: () => server, selectedServer: () => server,
serverEffectiveValue: () => effectiveServer || server serverEffectiveValue: () => effectiveServer || server
@@ -111,6 +114,9 @@ describe("auth plugin - actions", () => {
} }
}) })
}, },
errActions: {
newAuthErr: () => ({})
},
specSelectors: { specSelectors: {
isOAS3: () => false, isOAS3: () => false,
operationScheme: () => "https", operationScheme: () => "https",
@@ -139,6 +145,9 @@ describe("auth plugin - actions", () => {
fn: { fn: {
fetch: jest.fn().mockImplementation(() => Promise.resolve()) fetch: jest.fn().mockImplementation(() => Promise.resolve())
}, },
errActions: {
newAuthErr: () => ({})
},
getConfigs: () => ({}), getConfigs: () => ({}),
authSelectors: { authSelectors: {
getConfigs: () => ({ getConfigs: () => ({
@@ -294,6 +303,9 @@ describe("auth plugin - actions", () => {
getConfigs: () => ({ getConfigs: () => ({
persistAuthorization: true persistAuthorization: true
}), }),
errActions: {
newAuthErr: () => ({})
},
authSelectors: { authSelectors: {
authorized: jest.fn(() => Map(data)) authorized: jest.fn(() => Map(data))
} }