Skip to content
This repository has been archived by the owner on Dec 22, 2023. It is now read-only.

Commit

Permalink
Merge pull request #8 from openizr/0.0.19
Browse files Browse the repository at this point in the history
0.0.19
  • Loading branch information
matthieujabbour committed Jul 4, 2021
2 parents 220cabd + 9619d0c commit 9e7ca37
Show file tree
Hide file tree
Showing 43 changed files with 1,382 additions and 989 deletions.
3 changes: 2 additions & 1 deletion library/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@
"entry": {
"vue": "./scripts/vue.ts",
"main": "./scripts/main.ts",
"react": "./scripts/react.ts"
"react": "./scripts/react.ts",
"plugins": "./scripts/plugins.ts"
},
"runInDev": false,
"splitChunks": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,10 @@
/**
* diox mock.
*/
class Store {
public register = jest.fn();
const store = {
register: jest.fn(),
mutate: jest.fn(),
subscribe: jest.fn(),
};

public mutate = jest.fn();

public subscribe = jest.fn();
}

export default Store;
export default jest.fn(() => store);
47 changes: 47 additions & 0 deletions library/src/scripts/__mocks__/localforage.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/**
* Copyright (c) Matthieu Jabbour. All Rights Reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/

/**
* localforage mock.
*/
export default {
getItem: jest.fn(() => {
if (process.env.CACHE_EXISTING_FORM === 'true') {
return Promise.resolve(JSON.stringify({
formValues: { test: 'value' },
steps: [{
fields: [
{
id: 'test',
label: undefined,
message: null,
options: {},
status: 'initial',
type: 'Test',
value: undefined,
},
{
id: 'last',
label: undefined,
message: null,
options: {},
status: 'initial',
type: 'Test',
value: undefined,
},
],
id: 'test',
status: 'initial',
}],
}));
}
return Promise.resolve(null);
}),
setItem: jest.fn(() => Promise.resolve()),
removeItem: jest.fn(() => Promise.resolve()),
};
Loading

0 comments on commit 9e7ca37

Please sign in to comment.