Podopieczni: Sortuj + wartosc w jednym przycisku (spojne obramowanie)
This commit is contained in:
@@ -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 && (
|
||||
|
||||
@@ -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 }));
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user