mirror of
https://github.com/discourse/discourse.git
synced 2025-09-07 12:02:53 +08:00
Can refresh queued posts via button
This commit is contained in:
parent
cce8693354
commit
3cb4554bbb
8 changed files with 74 additions and 7 deletions
|
@ -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');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue