I'm using PouchDB/IndexedDB combo with EmberJS as an offline storage solution. Tests run fine in Chrome, however, when I run my acceptance tests in the PhantomJS headless browser, it falls back to Web SQL and 4 of my QUnit acceptance tests fail with:
{"status":500,"name":"web_sql_went_bad","message":"unknown","reason":"could not prepare statement (1 no such table: document-store)"}
QUnit acceptance test module:
moduleForAcceptance('Acceptance | location', {
beforeEach() {
Ember.run(() => {
let dbName = `stock-count_1`;
let db = new PouchDB(dbName);
db.destroy();
dbName = `stock-count_6`;
db = new PouchDB(dbName);
db.destroy();
});
server.createList('location', 10);
server.createList('area', 10);
server.createList('full-count', 10);
server.createList('product', 10);
server.create('period');
}
});
One of the tests that fails is not even testing the offline storage in any way, which leads me to believe it's an async issue that breaks all my tests in that file:
test('Clicking on the "New Area" button creates a blank area card', function (assert) {
locationPageObj.visit();
andThen(function () {
// locationPageObj.location.newAreaBtn.click();
$('.md-headline.flex-50').click();
});
andThen(function () {
// assert.equal(locationPageObj.location.areaCardsCount, 11, 'Blank new area card is created');
assert.equal($('.area-card').length, 11, 'Blank new area card is created');
});
});
Aucun commentaire:
Enregistrer un commentaire