Skip to content

Commit

Permalink
integrate redux-offline (fixes #105)
Browse files Browse the repository at this point in the history
  • Loading branch information
sheppard committed Jun 27, 2019
1 parent 29440fa commit fecf953
Show file tree
Hide file tree
Showing 10 changed files with 847 additions and 635 deletions.
3 changes: 3 additions & 0 deletions packages/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,8 @@
"@wq/store": "^1.1.2",
"@wq/template": "^1.1.2",
"localforage": "^1.7.3"
},
"devDependencies": {
"promise.prototype.finally": "^3.1.0"
}
}
7 changes: 5 additions & 2 deletions packages/app/src/__tests__/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@
import app from '../app';
import patterns from '../patterns';
import photos from '../photos';
import outbox from '@wq/outbox';
import router from '@wq/router';
import routeConfig from './config.json';
import templates from './templates.json';
import jQM from '@wq/jquery-mobile';
import { encode } from '@wq/outbox/vendor/json-forms';
import promiseFinally from 'promise.prototype.finally';

promiseFinally.shim();

var $, jqm;

Expand Down Expand Up @@ -90,11 +92,12 @@ test('item edit page', async () => {

// Submit form, confirm data is in outbox
await app.emptyOutbox();
await app.outbox.pause();
$page.find('input#values-0-value').val('Test Change');
$page = await submitForm($page);

expect(jqm.activePage.data('url')).toBe('/tests/items/');
const obdata = await outbox.model.load();
const obdata = await app.outbox.loadItems();
expect(obdata.list).toHaveLength(1);
var obitem = obdata.list[0];
expect(obitem.options.url).toBe('items/two');
Expand Down
Loading

0 comments on commit fecf953

Please sign in to comment.