test(persistence): add extra checks in getMessagesByCid along with pagination test in message, pinned message dao.
Signed-off-by: Sahil Kumar <[email protected]>
This commit is contained in:
@@ -284,10 +284,13 @@ void main() {
|
||||
|
||||
test('getMessagesByCid along with pagination', () async {
|
||||
const cid = 'testCid';
|
||||
const limit = 15;
|
||||
const lessThan = 'testMessageId${cid}25';
|
||||
const greaterThanOrEqual = 'testMessageId${cid}5';
|
||||
const pagination = PaginationParams(
|
||||
limit: 15,
|
||||
lessThan: 'testMessageId${cid}25',
|
||||
greaterThanOrEqual: 'testMessageId${cid}5',
|
||||
limit: limit,
|
||||
lessThan: lessThan,
|
||||
greaterThanOrEqual: greaterThanOrEqual,
|
||||
);
|
||||
|
||||
// Should be empty initially
|
||||
@@ -306,7 +309,9 @@ void main() {
|
||||
cid,
|
||||
messagePagination: pagination,
|
||||
);
|
||||
expect(fetchedMessages.length, 15);
|
||||
expect(fetchedMessages.length, limit);
|
||||
expect(fetchedMessages.first.id, greaterThanOrEqual);
|
||||
expect(fetchedMessages.last.id != lessThan, true);
|
||||
});
|
||||
|
||||
test('updateMessages', () async {
|
||||
|
||||
@@ -285,10 +285,13 @@ void main() {
|
||||
|
||||
test('getMessagesByCid along with pagination', () async {
|
||||
const cid = 'testCid';
|
||||
const limit = 15;
|
||||
const lessThan = 'testMessageId${cid}25';
|
||||
const greaterThanOrEqual = 'testMessageId${cid}5';
|
||||
const pagination = PaginationParams(
|
||||
limit: 15,
|
||||
lessThan: 'testMessageId${cid}25',
|
||||
greaterThanOrEqual: 'testMessageId${cid}5',
|
||||
limit: limit,
|
||||
lessThan: lessThan,
|
||||
greaterThanOrEqual: greaterThanOrEqual,
|
||||
);
|
||||
|
||||
// Should be empty initially
|
||||
@@ -307,7 +310,9 @@ void main() {
|
||||
cid,
|
||||
messagePagination: pagination,
|
||||
);
|
||||
expect(fetchedMessages.length, 15);
|
||||
expect(fetchedMessages.length, limit);
|
||||
expect(fetchedMessages.first.id, greaterThanOrEqual);
|
||||
expect(fetchedMessages.last.id != lessThan, true);
|
||||
});
|
||||
|
||||
test('updateMessages', () async {
|
||||
|
||||
Reference in New Issue
Block a user