Skip to content

Commit 5a7d298

Browse files
test: fix flaky test precondition
1 parent c62d51d commit 5a7d298

File tree

2 files changed

+18
-6
lines changed

2 files changed

+18
-6
lines changed

tests/e2e/prepareTelegramCampaign.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,9 @@ describe('web3telegram.prepareTelegramCampaign()', () => {
9191
'should prepare a telegram campaignRequest',
9292
async () => {
9393
// Fetch contacts with allowBulk access
94-
const contacts: Contact[] = await web3telegram.fetchMyContacts();
94+
const contacts: Contact[] = await web3telegram.fetchMyContacts({
95+
bulkOnly: true,
96+
});
9597
expect(contacts.length).toBeGreaterThanOrEqual(3);
9698

9799
const bulkOrders = contacts.map((contact) => contact.grantedAccess);

tests/e2e/sendTelegramCampaign.test.ts

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,9 @@ describe('web3telegram.sendTelegramCampaign() - Bulk Processing', () => {
130130
'should successfully process bulk request',
131131
async () => {
132132
// Fetch contacts with allowBulk access
133-
const contacts: Contact[] = await web3telegram.fetchMyContacts();
133+
const contacts: Contact[] = await web3telegram.fetchMyContacts({
134+
bulkOnly: true,
135+
});
134136
expect(contacts.length).toBeGreaterThanOrEqual(3);
135137

136138
// Ensure consumer has sufficient stake
@@ -178,7 +180,9 @@ describe('web3telegram.sendTelegramCampaign() - Bulk Processing', () => {
178180
'should successfully process bulk request with single contact',
179181
async () => {
180182
// Fetch contacts with allowBulk access
181-
const contacts: Contact[] = await web3telegram.fetchMyContacts();
183+
const contacts: Contact[] = await web3telegram.fetchMyContacts({
184+
bulkOnly: true,
185+
});
182186
expect(contacts.length).toBeGreaterThanOrEqual(1);
183187

184188
// Ensure consumer has sufficient stake
@@ -222,7 +226,9 @@ describe('web3telegram.sendTelegramCampaign() - Bulk Processing', () => {
222226
'should handle maxProtectedDataPerTask parameter correctly',
223227
async () => {
224228
// Fetch contacts with allowBulk access
225-
const contacts: Contact[] = await web3telegram.fetchMyContacts();
229+
const contacts: Contact[] = await web3telegram.fetchMyContacts({
230+
bulkOnly: true,
231+
});
226232
expect(contacts.length).toBeGreaterThanOrEqual(3);
227233

228234
// Ensure consumer has sufficient stake
@@ -270,7 +276,9 @@ describe('web3telegram.sendTelegramCampaign() - Bulk Processing', () => {
270276
'should handle custom senderName and label parameters',
271277
async () => {
272278
// Fetch contacts with allowBulk access
273-
const contacts: Contact[] = await web3telegram.fetchMyContacts();
279+
const contacts: Contact[] = await web3telegram.fetchMyContacts({
280+
bulkOnly: true,
281+
});
274282
expect(contacts.length).toBeGreaterThanOrEqual(1);
275283

276284
// Ensure consumer has sufficient stake
@@ -314,7 +322,9 @@ describe('web3telegram.sendTelegramCampaign() - Bulk Processing', () => {
314322
'should throw error when workerpoolAddressOrEns does not match campaignRequest.workerpool',
315323
async () => {
316324
// Fetch contacts with allowBulk access
317-
const contacts: Contact[] = await web3telegram.fetchMyContacts();
325+
const contacts: Contact[] = await web3telegram.fetchMyContacts({
326+
bulkOnly: true,
327+
});
318328
expect(contacts.length).toBeGreaterThanOrEqual(1);
319329

320330
const bulkOrders = contacts.map((contact) => contact.grantedAccess);

0 commit comments

Comments
 (0)