Debian Codegraph @

addons/point_of_sale/static/tests/unit/override/data_service.js

raw
1 import { PosData } from "@point_of_sale/app/services/data_service";
2 import { patch } from "@web/core/utils/patch";
3
4 /**
5 * Disable IndexedDB in Hoot tests to avoid creating to much IndexedDB databases
6 * when running the full test suite.
7 *
8 * IndexedDB is still tested in dedicated tours.
9 */
10 patch(PosData.prototype, {
11 setup() {
12 this.indexedDB = {
13 delete: async () => ({}),
14 create: async () => ({}),
15 reset: async () => ({}),
16 readAll: async () => ({}),
17 };
18 return super.setup(...arguments);
19 },
20 initIndexedDB() {
21 return true;
22 },
23 initListeners() {
24 return true;
25 },
26 synchronizeLocalDataInIndexedDB() {
27 return true;
28 },
29 async getCachedServerDataFromIndexedDB() {
30 return {};
31 },
32 async getLocalDataFromIndexedDB() {
33 return {};
34 },
35 });