Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions app/components/AppHeader.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { renderToString } from "@vue/server-renderer";
import { mount } from "@vue/test-utils";
import { flushPromises, mount } from "@vue/test-utils";
import { createSSRApp, nextTick } from "vue";
import { afterEach, describe, expect, it } from "vite-plus/test";
import AppHeader from "./AppHeader.vue";
Expand All @@ -22,14 +22,13 @@ describe("AppHeader", () => {
it("保存済みの配色設定をマウント後に反映する", async () => {
localStorage.setItem(STORAGE_KEY, "light");

const wrapper = mount(AppHeader);
const wrapper = mount(AppHeader, { attachTo: document.body });
await flushPromises();
await nextTick();

const select = wrapper.find("select").element as HTMLSelectElement;
expect(select.value).toBe("light");
// scheme が localStorage から復元され、DOM に反映されていることを確認
expect(document.documentElement.getAttribute("data-color-scheme")).toBe("light");

await wrapper.find("select").setValue("system");
wrapper.unmount();
});
});
7 changes: 5 additions & 2 deletions app/components/AppLogoMark.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,13 @@
viewBox="0 0 51.22 89.73"
xmlns="http://www.w3.org/2000/svg"
>
<path d="M25.61,10.25L31.52,0h19.7l-25.61,44.35L0,0h19.7l5.91,10.25Z" fill="var(--accent)" />
<path
d="M25.61,10.25L31.52,0h19.7l-25.61,44.35L0,0h19.7l5.91,10.25Z"
fill="var(--accent)"
></path>
<path
d="M26.19,89.73c12.25,0,22.19-9.93,22.19-22.19s-9.93-22.19-22.19-22.19-22.19,9.93-22.19,22.19,9.93,22.19,22.19,22.19Z"
fill="var(--accent)"
/>
></path>
</svg>
</template>
6 changes: 5 additions & 1 deletion app/components/DirectoryView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@ function toggleRow(name: string) {
else next.add(name);
openRows.value = next;
}

function toggleNameSort() {
sort.value = sort.value === "name-asc" ? "name-desc" : "name-asc";
}
</script>

<template>
Expand Down Expand Up @@ -132,7 +136,7 @@ function toggleRow(name: string) {
? 'bg-ink text-paper border-ink'
: 'border-rule text-ink-2 hover:text-ink hover:border-ink'
"
@click="sort = sort === 'name-asc' ? 'name-desc' : 'name-asc'"
@click="toggleNameSort()"
>
Name {{ sort === "name-desc" ? "Z→A" : "A→Z" }}
</button>
Expand Down
Loading