Skip to content

Commit

Permalink
fix mock issue that was preventing the viewer height sync
Browse files Browse the repository at this point in the history
  • Loading branch information
wpdas committed Apr 7, 2023
1 parent affd70b commit d8514d2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ export const REQUEST_KEYS = {
}

export const LOCAL_MOCK_KEYS = {
INITIAL_PAYLOAD: 'nsb:mock:initial-payload'
}
INITIAL_PAYLOAD: 'nsb:mock:initial-payload',
}
14 changes: 7 additions & 7 deletions src/request/mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ import isLocalDev from '../utils/isLocalDev'
import { loremIpsum, randName, randUserName } from '../utils/faker/elements'

/**
* Global mock state
* Global Mock State
*/
export const globalMock: Record<string, Function> = {}

/**
* Mock Options
*/
export const globalMock: Record<string, Function> = {
// Minimum mocked answers to make it works locally (localhost)
// auto inject "nsb:navigation:sync-content-height" mock
[REQUEST_KEYS.NAVIGATION_SYNC_CONTENT_HIGHT_VIEWER]: () => null,
}
let mockOptions: { delay: number } = { delay: 500 }

/**
Expand Down Expand Up @@ -53,7 +53,7 @@ export const createMockUser = (defaultValues?: {

/**
* Mock the `initialPayload` prop
* @param initialPayload
* @param initialPayload
*/
export const mockInitialPayload = (initialPayload: Record<any, any>) => {
globalMock[LOCAL_MOCK_KEYS.INITIAL_PAYLOAD] = () => initialPayload
Expand Down

0 comments on commit d8514d2

Please sign in to comment.