mirror of
https://github.com/discourse/discourse.git
synced 2025-05-23 14:41:25 +08:00
Can refresh queued posts via button
This commit is contained in:
@ -10,6 +10,7 @@ test('defaults', function() {
|
||||
ok(!rs.get('loadMoreUrl'));
|
||||
ok(!rs.get('loading'));
|
||||
ok(!rs.get('loadingMore'));
|
||||
ok(!rs.get('refreshing'));
|
||||
});
|
||||
|
||||
test('pagination support', function() {
|
||||
@ -18,11 +19,29 @@ test('pagination support', function() {
|
||||
equal(rs.get('length'), 2);
|
||||
equal(rs.get('totalRows'), 4);
|
||||
ok(rs.get('loadMoreUrl'), 'has a url to load more');
|
||||
ok(!rs.get('loadingMore'), 'it is not loading more');
|
||||
|
||||
rs.loadMore().then(function() {
|
||||
const promise = rs.loadMore();
|
||||
|
||||
ok(rs.get('loadingMore'), 'it is loading more');
|
||||
promise.then(function() {
|
||||
ok(!rs.get('loadingMore'), 'it finished loading more');
|
||||
equal(rs.get('length'), 4);
|
||||
ok(!rs.get('loadMoreUrl'));
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
test('refresh support', function() {
|
||||
const store = createStore();
|
||||
store.findAll('widget').then(function(rs) {
|
||||
equal(rs.get('refreshUrl'), '/widgets?refresh=true', 'it has the refresh url');
|
||||
|
||||
const promise = rs.refresh();
|
||||
|
||||
ok(rs.get('refreshing'), 'it is refreshing');
|
||||
promise.then(function() {
|
||||
ok(!rs.get('refreshing'), 'it is finished refreshing');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user