diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml index 0d9713896..58737ab83 100644 --- a/docker-compose.dev.yml +++ b/docker-compose.dev.yml @@ -35,6 +35,16 @@ services: depends_on: - backend + frontend-test: + image: node:24 + working_dir: /app + volumes: + - ./ui:/app + - node-modules:/app/node_modules + command: sh -c "npm ci && npm test" + profiles: + - test + volumes: go-mod-cache: go-build-cache: diff --git a/ui/src/common/ContextMenus.test.jsx b/ui/src/common/ContextMenus.test.jsx new file mode 100644 index 000000000..787e30805 --- /dev/null +++ b/ui/src/common/ContextMenus.test.jsx @@ -0,0 +1,99 @@ +import React from 'react' +import { render, screen } from '@testing-library/react' +import { describe, it, expect, vi, beforeEach } from 'vitest' +import { AlbumContextMenu, ArtistContextMenu } from './ContextMenus' + +const capturedLoveButtonProps = {} + +vi.mock('./LoveButton', () => ({ + LoveButton: (props) => { + Object.assign(capturedLoveButtonProps, props) + return props.visible ?