mirror of
https://git.um-react.app/um/um-react.git
synced 2025-11-28 03:23:02 +00:00
fix: build/test issue
This commit is contained in:
@@ -5,14 +5,14 @@ export function Footer() {
|
||||
const appVersionShort = '__APP_VERSION_SHORT__';
|
||||
return (
|
||||
<footer className="flex flex-col text-center p-4 bg-base-200">
|
||||
<p className="flex flex-row justify-center items-center h-[1em]">
|
||||
<div className="flex flex-row justify-center items-center h-[1em]">
|
||||
<a className="link link-info mr-1" href="https://git.unlock-music.dev/um/um-react">
|
||||
音乐解锁
|
||||
</a>
|
||||
(v{appVersionShort}
|
||||
<SDKVersion />) - 移除已购音乐的加密保护。
|
||||
</p>
|
||||
<p>
|
||||
</div>
|
||||
<div>
|
||||
{'© 2019 - '}
|
||||
<CurrentYear />{' '}
|
||||
<a className="link link-info" href="https://git.unlock-music.dev/um">
|
||||
@@ -22,7 +22,7 @@ export function Footer() {
|
||||
<a className="link link-info" href="https://git.unlock-music.dev/um/um-react/src/branch/main/LICENSE">
|
||||
使用 MIT 授权协议
|
||||
</a>
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -28,7 +28,9 @@ export function SDKVersion() {
|
||||
<h3 className="font-bold text-lg">详细信息</h3>
|
||||
|
||||
<p>App: __APP_VERSION__</p>
|
||||
<p>SDK: {sdkVersion}</p>
|
||||
<p>
|
||||
SDK: <span data-testid="sdk-version">{sdkVersion}</span>
|
||||
</p>
|
||||
</div>
|
||||
<form method="dialog" className="modal-backdrop">
|
||||
<button>关闭</button>
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
import { useRef } from 'react';
|
||||
import { DecryptedAudioFile, deleteFile, ProcessState } from './fileListingSlice';
|
||||
import { useAppDispatch } from '~/hooks';
|
||||
import { AnimationDefinition } from 'framer-motion';
|
||||
import { FileError } from './FileError';
|
||||
import classNames from 'classnames';
|
||||
|
||||
@@ -11,7 +9,6 @@ interface FileRowProps {
|
||||
}
|
||||
|
||||
export function FileRow({ id, file }: FileRowProps) {
|
||||
// const { isOpen, onClose } = useDisclosure({ defaultIsOpen: true });
|
||||
const dispatch = useAppDispatch();
|
||||
const isDecrypted = file.state === ProcessState.COMPLETE;
|
||||
const metadata = file.metadata;
|
||||
@@ -19,13 +16,6 @@ export function FileRow({ id, file }: FileRowProps) {
|
||||
const nameWithoutExt = file.fileName.replace(/\.[a-z\d]{3,6}$/, '');
|
||||
const decryptedName = nameWithoutExt + '.' + file.ext;
|
||||
|
||||
const audioPlayerRef = useRef<HTMLAudioElement>(null);
|
||||
const _onCollapseAnimationComplete = (definition: AnimationDefinition) => {
|
||||
if (definition === 'exit') {
|
||||
dispatch(deleteFile({ id }));
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="card bg-base-100 shadow-sm w-full md:w-[30%] " data-testid="file-row">
|
||||
<div className="card-body items-center text-center px-2">
|
||||
@@ -45,7 +35,6 @@ export function FileRow({ id, file }: FileRowProps) {
|
||||
controls
|
||||
autoPlay={false}
|
||||
src={file.decrypted}
|
||||
ref={audioPlayerRef}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
|
||||
@@ -17,8 +17,4 @@ test('should render metadata when file has been processed', () => {
|
||||
renderWithProviders(<FileRow id="file://done" file={completedFile} />);
|
||||
|
||||
expect(screen.getAllByTestId('file-row')).toHaveLength(1);
|
||||
expect(screen.getByTestId('audio-meta-song-name')).toHaveTextContent('Für Alice');
|
||||
expect(screen.getByTestId('audio-meta-album-name')).toHaveTextContent("NOW That's What I Call Cryptography 2023");
|
||||
expect(screen.getByTestId('audio-meta-song-artist')).toHaveTextContent('Jixun');
|
||||
expect(screen.getByTestId('audio-meta-album-artist')).toHaveTextContent('Cipher Lovers');
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user