mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
feat(media hosting): add imgbb provider
This commit is contained in:
@@ -9,6 +9,7 @@ describe('media-upload-recipes', () => {
|
||||
it('exports MEDIA_UPLOAD_RECIPES with expected providers', () => {
|
||||
expect(Object.keys(MEDIA_UPLOAD_RECIPES)).toContain('catbox');
|
||||
expect(Object.keys(MEDIA_UPLOAD_RECIPES)).toContain('imgur');
|
||||
expect(Object.keys(MEDIA_UPLOAD_RECIPES)).toContain('imgbb');
|
||||
});
|
||||
|
||||
it('validateRecipes passes for current recipes', () => {
|
||||
@@ -31,6 +32,12 @@ describe('media-upload-recipes', () => {
|
||||
expect(MEDIA_UPLOAD_RECIPES.imgur.timeoutMs).toBe(45_000);
|
||||
});
|
||||
|
||||
it('imgbb targets full image embed codes and has Android parity timeout', () => {
|
||||
expect(MEDIA_UPLOAD_RECIPES.imgbb.timeoutMs).toBe(60_000);
|
||||
expect(MEDIA_UPLOAD_RECIPES.imgbb.uploadUrl).toBe('https://imgbb.com/');
|
||||
expect(MEDIA_UPLOAD_RECIPES.imgbb.successExtractor.selectorCandidates).toContain('input[name="html-embed-medium"]');
|
||||
});
|
||||
|
||||
it('selector fallback order: generic file input before provider-specific', () => {
|
||||
for (const [, recipe] of Object.entries(MEDIA_UPLOAD_RECIPES)) {
|
||||
const first = recipe.fileInputSelectorCandidates[0];
|
||||
|
||||
Reference in New Issue
Block a user