Skip to content

Commit ad90068

Browse files
authored
Fix test to pass after disable delete community (#699)
* Fix test to pass after disable delete community Change back after #697 is merge * Apply prettier * Fix bot version on lock file
1 parent 91ca64e commit ad90068

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/bot/bot.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ describe('Bot Initialization', () => {
310310
deleteOrders: sinon.stub().resolves(),
311311
calculateEarnings: sinon.stub().resolves(),
312312
attemptCommunitiesPendingPayments: sinon.stub().resolves(),
313-
deleteCommunity: sinon.stub().resolves(),
313+
// deleteCommunity: sinon.stub().resolves(),
314314
nodeInfo: sinon.stub().resolves(),
315315
},
316316
'./modules/community': { configure: sinon.stub() },
@@ -470,7 +470,7 @@ describe('Bot Initialization', () => {
470470

471471
scheduledFunction();
472472

473-
expect(scheduleStub.scheduleJob.callCount).to.be.equal(8);
473+
expect(scheduleStub.scheduleJob.callCount).to.be.equal(7);
474474
expect(scheduleStub.scheduleJob.getCall(0).args[0]).to.equal(
475475
'*/10 * * * *',
476476
);

util/imageCache.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,11 +115,16 @@ class ImageCacheManager {
115115
try {
116116
// Check if the image is already base64 data (legacy format)
117117
// Base64 strings are much longer than filenames and typically don't contain file extensions in the middle
118-
if (image.length > 100 && !image.includes('.png') && !image.includes('.jpg') && !image.includes('.jpeg')) {
118+
if (
119+
image.length > 100 &&
120+
!image.includes('.png') &&
121+
!image.includes('.jpg') &&
122+
!image.includes('.jpeg')
123+
) {
119124
logger.debug('Image appears to be base64 data, returning as-is');
120125
return image;
121126
}
122-
127+
123128
// Otherwise, treat as filename and read from disk
124129
const imageData = await fs.readFile(`images/${image}`);
125130
return imageData.toString('base64');

0 commit comments

Comments
 (0)