mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
feat(flash board): add SWF posting support (#1145)
This commit is contained in:
@@ -201,7 +201,7 @@ describe('use-directories', () => {
|
||||
updatedAt: 2,
|
||||
communities: [
|
||||
{ address: 'music-posting.bso', title: '/mu/ - Cached Music', nsfw: false },
|
||||
{ address: 'flash.bso', title: '/f/ - Flash', nsfw: true },
|
||||
{ address: 'flash-posting.bso', title: '/f/ - Flash', nsfw: true },
|
||||
],
|
||||
};
|
||||
|
||||
@@ -225,8 +225,8 @@ describe('use-directories', () => {
|
||||
|
||||
expect(fetchMock).toHaveBeenCalled();
|
||||
expect(latestSnapshot?.state.loading).toBe(false);
|
||||
expect(latestSnapshot?.state.communities.map((community) => community.address)).toEqual(['music-posting.bso', 'flash.bso']);
|
||||
expect(latestSnapshot?.addresses).toEqual(['music-posting.bso', 'flash.bso']);
|
||||
expect(latestSnapshot?.state.communities.map((community) => community.address)).toEqual(['music-posting.bso', 'flash-posting.bso']);
|
||||
expect(latestSnapshot?.addresses).toEqual(['music-posting.bso', 'flash-posting.bso']);
|
||||
expect(latestSnapshot?.directory?.address).toBe('music-posting.bso');
|
||||
expect(latestSnapshot?.metadata).toEqual({
|
||||
title: 'Cached directories',
|
||||
|
||||
@@ -157,6 +157,7 @@ describe('useFileUpload', () => {
|
||||
await act(async () => {
|
||||
uploadPromise = hook().handleUpload();
|
||||
});
|
||||
expect((document.querySelector('input[type="file"]') as HTMLInputElement | null)?.accept).toContain('.swf');
|
||||
await selectFileFromHiddenInput(selectedFile);
|
||||
await act(async () => {
|
||||
await uploadPromise;
|
||||
|
||||
@@ -111,7 +111,7 @@ function selectFileViaInput(): Promise<File | null> {
|
||||
return new Promise((resolve) => {
|
||||
const input = document.createElement('input');
|
||||
input.type = 'file';
|
||||
input.accept = 'image/jpeg,image/png,video/mp4,video/webm';
|
||||
input.accept = 'image/jpeg,image/png,video/mp4,video/webm,.swf,application/x-shockwave-flash,application/vnd.adobe.flash.movie';
|
||||
input.style.display = 'none';
|
||||
let resolved = false;
|
||||
let focusTimeoutId: number | null = null;
|
||||
|
||||
Reference in New Issue
Block a user