Skip to content

Playlist sorting tests - #2134

Open
nukeop wants to merge 3 commits into
masterfrom
feat/playlist-sort
Open

Playlist sorting tests#2134
nukeop wants to merge 3 commits into
masterfrom
feat/playlist-sort

Conversation

@nukeop

@nukeop nukeop commented Aug 4, 2026

Copy link
Copy Markdown
Owner

No description provided.

@codecov

codecov Bot commented Aug 4, 2026

Copy link
Copy Markdown

❌ 8 Tests Failed:

Tests completed Failed Passed Skipped
979 8 971 1
View the top 3 failed test(s) by shortest run time
src/views/Playlists/Playlists.test.tsx > Playlists view > sorting > shows the oldest playlists first by default
Stack Traces | 0.107s run time
AssertionError: expected [ 'Delta Jazz', 'Alpha Rock', …(2) ] to deeply equal [ 'Charlie Jazz', 'Alpha Rock', …(2) ]

- Expected
+ Received

  [
-   "Charlie Jazz",
+   "Delta Jazz",
    "Alpha Rock",
+   "Charlie Jazz",
    "Bravo Rock",
-   "Delta Jazz",
  ]

 ❯ .../views/Playlists/Playlists.test.tsx:225:42
src/views/Playlists/Playlists.test.tsx > Playlists view > sorting > sorts the playlists left over after filtering
Stack Traces | 0.176s run time
TestingLibraryElementError: Unable to find an element by: [data-testid="sort-direction-button"]

Ignored nodes: comments, script, style
<body>
  <div>
    <div
      class="grid h-screen w-screen grid-rows-[auto_1fr_auto] overflow-hidden"
    >
      <div>
        <header
          class="bg-background-secondary border-border grid h-12 grid-cols-[1fr_4fr_1fr] items-center gap-2 border-b-(length:--border-width) px-3 select-none"
          data-tauri-drag-region="true"
        >
          <div
            class="flex flex-row items-center gap-4"
          >
            <div
              class="flex items-center"
            >
              <span
                class="ml-0.5 dark:hidden"
              >
                <svg
                  class="h-6 w-6"
                  height="100"
                  id="svg2"
                  viewBox="0 0 99.999998 100"
                  width="100"
                  xmlns="http://www.w3.org/2000/svg"
                  xmlns:svg="http://www.w3.org/2000/svg"
                >
                  <defs
                    id="defs2"
                  />
                  <path
                    d="M 49.999997,5.5078125e-6 C 10.000227,5.5078125e-6 -2.8686701e-6,10.000046 -2.8686701e-6,50.000006 -2.8686701e-6,89.999966 10.000227,100.00001 49.999997,100.00001 c 39.99977,0 50,-10.000044 50,-50.000004 0,-39.99996 -10.00023,-50.0000004921875 -50,-50.0000004921875 z M 29.999997,23.599616 h 40 l -20,26.40039 h 40 l -20,26.40039 -20,-26.40039 -20,26.40039 L 9.9999971,50.000006 H 49.999997 Z"
                    id="path1"
                    style="fill: #000000; stroke-width: 0.999999;"
                  />
                </svg>
              </span>
              <span
                class="ml-0.5 hidden dark:block!"
              >
                <svg
                  class="h-6 w-6"
                  height="100"
                  id="svg2"
                  viewBox="0 0 99.999998 100"
                  width="100"
                  xmlns="http://www.w3.org/2000/svg"
                  xmlns:svg="http://www.w3.org/2000/svg"
                >
                  <defs
                    id="defs2"
                  />
                  <path
                    d="M 50,0 C 10.00023,0 0,10.00004 0,50 0,89.99996 10.00023,100 50,100 89.99977,100 100,89.99996 100,50 100,10.00004 89.99977,0 50,0 Z M 30,23.59961 H 70 L 50,50 H 90 L 70,76.40039 50,50 30,76.40039 10,50 h 40 z"
                    id="path1"
                    style="fill: #ffffff; fill-opacity: 1; stroke-width: 0.999999;"
                  />
                </svg>
              </span>
            </div>
            <div
              class="flex flex-row items-center gap-2"
            >
              <button
                class="inline-flex cursor-pointer items-center rounded-md whitespace-nowrap transition-all outline-none disabled:cursor-not-allowed disabled:opacity-50 text-foreground bg-primary border-border shadow-shadow hover:translate-x-shadow-x hover:translate-y-shadow-y border-(length:--border-width) hover:shadow-none size-8 justify-center"
                data-disabled=""
                data-headlessui-state="disabled"
                disabled=""
                type="button"
              >
                <svg
                  aria-hidden="true"
                  class="lucide lucide-chevron-left"
                  fill="none"
                  height="16"
                  stroke="currentColor"
                  stroke-linecap="round"
                  stroke-linejoin="round"
                  stroke-width="2"
                  viewBox="0 0 24 24"
                  width="16"
                  xmlns="http://www.w3.org/2000/svg"
                >
                  <path
                    d="m15 18-6-6 6-6"
                  />
                </svg>
              </button>
              <button
                class="inline-flex cursor-pointer items-center rounded-md whitespace-nowrap transition-all outline-none disabled:cursor-not-allowed disabled:opacity-50 text-foreground bg-primary border-border shadow-shadow hover:translate-x-shadow-x hover:translate-y-shadow-y border-(length:--border-width) hover:shadow-none size-8 justify-center"
                data-disabled=""
                data-headlessui-state="disabled"
                disabled=""
                type="button"
              >
                <svg
                  aria-hidden="true"
                  class="lucide lucide-chevron-right"
                  fill="none"
                  height="16"
                  stroke="currentColor"
                  stroke-linecap="round"
                  stroke-linejoin="round"
                  stroke-width="2"
                  viewBox="0 0 24 24"
                  width="16"
                  xmlns="http://www.w3.org/2000/svg"
                >
                  <path
                    d="m9 18 6-6-6-6"
                  />
                </svg>
              </button>
            </div>
          </div>
          <div
            class="relative w-full"
          >
            <svg
              aria-hidden="true"
              class="lucide lucide-search text-foreground-secondary pointer-events-none absolute top-1/2 left-2.5 size-4...
 ❯ Object.getElementError ../../node_modules/.pnpm/@testing-library+dom@10.4.1/node_modules/@.../dom/dist/config.js:37:19
 ❯ ../../node_modules/.pnpm/@testing-library+dom@10.4.1/node_modules/@.../dom/dist/query-helpers.js:76:38
 ❯ ../../node_modules/.pnpm/@testing-library+dom@10.4.1/node_modules/@.../dom/dist/query-helpers.js:52:17
 ❯ ../../node_modules/.pnpm/@testing-library+dom@10.4.1/node_modules/@.../dom/dist/query-helpers.js:95:19
 ❯ Object.get element [as element] .../views/Playlists/Playlists.test-wrapper.tsx:71:23
 ❯ Object.toggle .../views/Playlists/Playlists.test-wrapper.tsx:74:31
 ❯ .../views/Playlists/Playlists.test.tsx:297:45
src/views/Playlists/Playlists.test.tsx > Playlists view > sorting > sorts by total length
Stack Traces | 0.226s run time
AssertionError: expected [ 'Delta Jazz', 'Alpha Rock', …(2) ] to deeply equal [ 'Alpha Rock', 'Bravo Rock', …(2) ]

- Expected
+ Received

  [
-   "Alpha Rock",
-   "Bravo Rock",
    "Delta Jazz",
+   "Alpha Rock",
    "Charlie Jazz",
+   "Bravo Rock",
  ]

 ❯ .../views/Playlists/Playlists.test.tsx:286:42
src/views/Playlists/Playlists.test.tsx > Playlists view > sorting > sorts by number of tracks
Stack Traces | 0.271s run time
AssertionError: expected [ 'Delta Jazz', 'Alpha Rock', …(2) ] to deeply equal [ 'Bravo Rock', 'Delta Jazz', …(2) ]

- Expected
+ Received

  [
-   "Bravo Rock",
    "Delta Jazz",
-   "Charlie Jazz",
    "Alpha Rock",
+   "Charlie Jazz",
+   "Bravo Rock",
  ]

 ❯ .../views/Playlists/Playlists.test.tsx:274:42
src/views/Playlists/Playlists.test.tsx > Playlists view > sorting > sorts by date modified
Stack Traces | 0.276s run time
AssertionError: expected [ 'Delta Jazz', 'Alpha Rock', …(2) ] to deeply equal [ 'Delta Jazz', 'Charlie Jazz', …(2) ]

- Expected
+ Received

  [
    "Delta Jazz",
+   "Alpha Rock",
    "Charlie Jazz",
    "Bravo Rock",
-   "Alpha Rock",
  ]

 ❯ .../views/Playlists/Playlists.test.tsx:262:42
src/views/Playlists/Playlists.test.tsx > Playlists view > sorting > reverses the order when the direction is flipped
Stack Traces | 0.29s run time
TestingLibraryElementError: Unable to find an element by: [data-testid="sort-direction-button"]

Ignored nodes: comments, script, style
<body>
  <div>
    <div
      class="grid h-screen w-screen grid-rows-[auto_1fr_auto] overflow-hidden"
    >
      <div>
        <header
          class="bg-background-secondary border-border grid h-12 grid-cols-[1fr_4fr_1fr] items-center gap-2 border-b-(length:--border-width) px-3 select-none"
          data-tauri-drag-region="true"
        >
          <div
            class="flex flex-row items-center gap-4"
          >
            <div
              class="flex items-center"
            >
              <span
                class="ml-0.5 dark:hidden"
              >
                <svg
                  class="h-6 w-6"
                  height="100"
                  id="svg2"
                  viewBox="0 0 99.999998 100"
                  width="100"
                  xmlns="http://www.w3.org/2000/svg"
                  xmlns:svg="http://www.w3.org/2000/svg"
                >
                  <defs
                    id="defs2"
                  />
                  <path
                    d="M 49.999997,5.5078125e-6 C 10.000227,5.5078125e-6 -2.8686701e-6,10.000046 -2.8686701e-6,50.000006 -2.8686701e-6,89.999966 10.000227,100.00001 49.999997,100.00001 c 39.99977,0 50,-10.000044 50,-50.000004 0,-39.99996 -10.00023,-50.0000004921875 -50,-50.0000004921875 z M 29.999997,23.599616 h 40 l -20,26.40039 h 40 l -20,26.40039 -20,-26.40039 -20,26.40039 L 9.9999971,50.000006 H 49.999997 Z"
                    id="path1"
                    style="fill: #000000; stroke-width: 0.999999;"
                  />
                </svg>
              </span>
              <span
                class="ml-0.5 hidden dark:block!"
              >
                <svg
                  class="h-6 w-6"
                  height="100"
                  id="svg2"
                  viewBox="0 0 99.999998 100"
                  width="100"
                  xmlns="http://www.w3.org/2000/svg"
                  xmlns:svg="http://www.w3.org/2000/svg"
                >
                  <defs
                    id="defs2"
                  />
                  <path
                    d="M 50,0 C 10.00023,0 0,10.00004 0,50 0,89.99996 10.00023,100 50,100 89.99977,100 100,89.99996 100,50 100,10.00004 89.99977,0 50,0 Z M 30,23.59961 H 70 L 50,50 H 90 L 70,76.40039 50,50 30,76.40039 10,50 h 40 z"
                    id="path1"
                    style="fill: #ffffff; fill-opacity: 1; stroke-width: 0.999999;"
                  />
                </svg>
              </span>
            </div>
            <div
              class="flex flex-row items-center gap-2"
            >
              <button
                class="inline-flex cursor-pointer items-center rounded-md whitespace-nowrap transition-all outline-none disabled:cursor-not-allowed disabled:opacity-50 text-foreground bg-primary border-border shadow-shadow hover:translate-x-shadow-x hover:translate-y-shadow-y border-(length:--border-width) hover:shadow-none size-8 justify-center"
                data-disabled=""
                data-headlessui-state="disabled"
                disabled=""
                type="button"
              >
                <svg
                  aria-hidden="true"
                  class="lucide lucide-chevron-left"
                  fill="none"
                  height="16"
                  stroke="currentColor"
                  stroke-linecap="round"
                  stroke-linejoin="round"
                  stroke-width="2"
                  viewBox="0 0 24 24"
                  width="16"
                  xmlns="http://www.w3.org/2000/svg"
                >
                  <path
                    d="m15 18-6-6 6-6"
                  />
                </svg>
              </button>
              <button
                class="inline-flex cursor-pointer items-center rounded-md whitespace-nowrap transition-all outline-none disabled:cursor-not-allowed disabled:opacity-50 text-foreground bg-primary border-border shadow-shadow hover:translate-x-shadow-x hover:translate-y-shadow-y border-(length:--border-width) hover:shadow-none size-8 justify-center"
                data-disabled=""
                data-headlessui-state="disabled"
                disabled=""
                type="button"
              >
                <svg
                  aria-hidden="true"
                  class="lucide lucide-chevron-right"
                  fill="none"
                  height="16"
                  stroke="currentColor"
                  stroke-linecap="round"
                  stroke-linejoin="round"
                  stroke-width="2"
                  viewBox="0 0 24 24"
                  width="16"
                  xmlns="http://www.w3.org/2000/svg"
                >
                  <path
                    d="m9 18 6-6-6-6"
                  />
                </svg>
              </button>
            </div>
          </div>
          <div
            class="relative w-full"
          >
            <svg
              aria-hidden="true"
              class="lucide lucide-search text-foreground-secondary pointer-events-none absolute top-1/2 left-2.5 size-4...
 ❯ Object.getElementError ../../node_modules/.pnpm/@testing-library+dom@10.4.1/node_modules/@.../dom/dist/config.js:37:19
 ❯ ../../node_modules/.pnpm/@testing-library+dom@10.4.1/node_modules/@.../dom/dist/query-helpers.js:76:38
 ❯ ../../node_modules/.pnpm/@testing-library+dom@10.4.1/node_modules/@.../dom/dist/query-helpers.js:52:17
 ❯ ../../node_modules/.pnpm/@testing-library+dom@10.4.1/node_modules/@.../dom/dist/query-helpers.js:95:19
 ❯ Object.get element [as element] .../views/Playlists/Playlists.test-wrapper.tsx:71:23
 ❯ Object.toggle .../views/Playlists/Playlists.test-wrapper.tsx:74:31
 ❯ .../views/Playlists/Playlists.test.tsx:248:45
src/views/Playlists/Playlists.test.tsx > Playlists view > sorting > sorts by name
Stack Traces | 0.299s run time
AssertionError: expected [ 'Delta Jazz', 'Alpha Rock', …(2) ] to deeply equal [ 'Alpha Rock', 'Bravo Rock', …(2) ]

- Expected
+ Received

  [
+   "Delta Jazz",
    "Alpha Rock",
-   "Bravo Rock",
    "Charlie Jazz",
-   "Delta Jazz",
+   "Bravo Rock",
  ]

 ❯ .../views/Playlists/Playlists.test.tsx:237:42
src/views/Playlists/Playlists.test.tsx > Playlists view > sorting > keeps the chosen sort after leaving the page and coming back
Stack Traces | 0.454s run time
AssertionError: expected 'Date added' to be 'Name' // Object.is equality

Expected: "Name"
Received: "Date added"

 ❯ .../views/Playlists/Playlists.test.tsx:313:55

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant