use oxfmt instead of prettier

This commit is contained in:
pa
2026-03-13 22:30:12 +09:00
parent 82122a4fab
commit 7b7c1b4568
155 changed files with 3467 additions and 1631 deletions
+31 -10
View File
@@ -3,7 +3,10 @@ import { nextTick, ref } from 'vue';
import { flushPromises, mount } from '@vue/test-utils';
const mocks = vi.hoisted(() => ({
currentUser: { value: { currentAvatar: 'avtr_current', $previousAvatarSwapTime: 0 }, __v_isRef: true },
currentUser: {
value: { currentAvatar: 'avtr_current', $previousAvatarSwapTime: 0 },
__v_isRef: true
},
modalConfirm: vi.fn(),
configGetString: vi.fn(),
configSetString: vi.fn(),
@@ -76,7 +79,8 @@ vi.mock('../../../stores', () => ({
vi.mock('../../../coordinators/avatarCoordinator', () => ({
applyAvatar: (...args) => mocks.applyAvatar(...args),
selectAvatarWithoutConfirmation: (...args) => mocks.selectAvatarWithoutConfirmation(...args),
selectAvatarWithoutConfirmation: (...args) =>
mocks.selectAvatarWithoutConfirmation(...args),
showAvatarDialog: (...args) => mocks.showAvatarDialog(...args)
}));
@@ -140,7 +144,10 @@ vi.mock('../composables/useAvatarCardGrid.js', () => ({
gridStyle: ref(() => ({ '--avatar-grid-columns': '1' })),
chunkIntoRows: (items, prefix = 'row') =>
Array.isArray(items)
? items.map((item, index) => ({ key: `${prefix}:${index}`, items: [item] }))
? items.map((item, index) => ({
key: `${prefix}:${index}`,
items: [item]
}))
: [],
estimateRowHeight: () => 80,
updateContainerWidth: vi.fn()
@@ -215,7 +222,8 @@ vi.mock('../../../components/ui/badge', () => ({
vi.mock('../../../components/ui/button', () => ({
Button: {
emits: ['click'],
template: '<button data-testid="button" @click="$emit(\'click\')"><slot /></button>'
template:
'<button data-testid="button" @click="$emit(\'click\')"><slot /></button>'
}
}));
@@ -248,7 +256,8 @@ vi.mock('../components/MyAvatarCard.vue', () => ({
default: {
props: ['avatar'],
emits: ['click', 'context-action'],
template: '<button data-testid="avatar-card" @click="$emit(\'click\')">{{ avatar.name }}</button>'
template:
'<button data-testid="avatar-card" @click="$emit(\'click\')">{{ avatar.name }}</button>'
}
}));
@@ -278,7 +287,10 @@ describe('MyAvatars.vue', () => {
beforeEach(() => {
vi.clearAllMocks();
mocks.currentUser.value = { currentAvatar: 'avtr_current', $previousAvatarSwapTime: 0 };
mocks.currentUser.value = {
currentAvatar: 'avtr_current',
$previousAvatarSwapTime: 0
};
mocks.modalConfirm.mockResolvedValue({ ok: true });
mocks.configGetString.mockImplementation((key, defaultValue) => {
if (key === 'VRCX_MyAvatarsViewMode') {
@@ -286,7 +298,9 @@ describe('MyAvatars.vue', () => {
}
return Promise.resolve(defaultValue ?? '');
});
mocks.getAllAvatarTags.mockResolvedValue(new Map([['avtr_1', [{ tag: 'fun', color: null }]]]));
mocks.getAllAvatarTags.mockResolvedValue(
new Map([['avtr_1', [{ tag: 'fun', color: null }]]])
);
mocks.getAvatarTimeSpent.mockResolvedValue({ timeSpent: 1000 });
mocks.processBulk.mockImplementation(async ({ handle, done }) => {
handle({
@@ -316,7 +330,9 @@ describe('MyAvatars.vue', () => {
const wrapper = mount(MyAvatars);
await flushAll();
expect(wrapper.find('[data-testid="table-layout"]').exists()).toBe(true);
expect(wrapper.find('[data-testid="table-layout"]').exists()).toBe(
true
);
});
test('persists view mode when toggled', async () => {
@@ -325,7 +341,10 @@ describe('MyAvatars.vue', () => {
await wrapper.get('[data-testid="set-table"]').trigger('click');
expect(mocks.configSetString).toHaveBeenCalledWith('VRCX_MyAvatarsViewMode', 'table');
expect(mocks.configSetString).toHaveBeenCalledWith(
'VRCX_MyAvatarsViewMode',
'table'
);
});
test('confirms and selects avatar when grid card is clicked', async () => {
@@ -336,6 +355,8 @@ describe('MyAvatars.vue', () => {
await flushAll();
expect(mocks.modalConfirm).toHaveBeenCalled();
expect(mocks.selectAvatarWithoutConfirmation).toHaveBeenCalledWith('avtr_1');
expect(mocks.selectAvatarWithoutConfirmation).toHaveBeenCalledWith(
'avtr_1'
);
});
});