open-vault/ui/tests/helpers/poll-cluster.js

14 lines
357 B
JavaScript
Raw Normal View History

import { run } from '@ember/runloop';
import { registerAsyncHelper } from '@ember/test';
2018-04-03 14:16:57 +00:00
export function pollCluster(owner) {
const clusterRoute = owner.lookup('route:vault/cluster');
return run(() => {
2018-04-03 14:16:57 +00:00
return clusterRoute.controller.model.reload();
});
}
registerAsyncHelper('pollCluster', function(app) {
pollCluster(app.__container__);
2018-04-03 14:16:57 +00:00
});