Podopieczni: Sortuj + wartosc w jednym przycisku (spojne obramowanie)

This commit is contained in:
tisachi
2026-09-11 16:19:41 +02:00
parent 5fdf1f3994
commit 688113f69f
2 changed files with 5 additions and 7 deletions

View File

@@ -119,18 +119,16 @@ export default function Trainees() {
title: 'Podopieczni',
search: 'trainees',
filters: [
/* sortowanie: przycisk „Sortuj” + rozwijany select (kompaktowo w grupie filtrów) */
<div key="sort" className="relative flex items-center gap-2">
<span className="text-[0.85rem] font-semibold text-dim">Sortuj</span>
/* sortowanie: jeden przycisk „Sortuj: <wartość>” + rozwijany select (kompaktowo w grupie filtrów) */
<div key="sort" className="relative">
<Button
size="sm"
variant="secondary"
onClick={() => setSortOpen((o) => !o)}
aria-haspopup="true"
aria-expanded={sortOpen}
aria-label="Sortuj podopiecznych"
>
{SORT_OPTIONS.find((s) => s.id === sortKey)?.label}
Sortuj: {SORT_OPTIONS.find((s) => s.id === sortKey)?.label}
<ChevronDown className="w-4 h-4" />
</Button>
{sortOpen && (

View File

@@ -366,9 +366,9 @@ describe('Trainees — lista i szczegóły', () => {
Array.from(document.querySelectorAll('button'))
.filter((b) => NAMES.some((n) => b.textContent?.includes(n)))
.map((b) => NAMES.find((n) => b.textContent!.includes(n))!);
// wybór opcji sortowania: otwórz dropdown „Sortuj” i kliknij opcję
// wybór opcji sortowania: otwórz dropdown „Sortuj: …” i kliknij opcję
const pickSort = async (option: string) => {
await user.click(screen.getByRole('button', { name: 'Sortuj podopiecznych' }));
await user.click(screen.getByRole('button', { name: /Sortuj:/ }));
await user.click(await screen.findByRole('button', { name: option }));
};