- Redesign website homepage & product-center per Figma (fonts, logos, hero/footer/customer cases) - Add API upload module (multer) with static serving for uploads/public assets - Add OriginGood.delisted flag and SDS request retry logic - Add admin ImageUpload component and goods import/upload flows - Add vitest suite for website components and composables (32 tests) - Add skills, docs, plans and PRODUCT.md
20 lines
877 B
TypeScript
20 lines
877 B
TypeScript
import { mount } from '@vue/test-utils';
|
|
import { describe, expect, it } from 'vitest';
|
|
import ProductCard from '../app/components/product/ProductCard.vue';
|
|
import type { Product } from '../app/composables/useProductCenter';
|
|
|
|
describe('ProductCard', () => {
|
|
it('links the entire product card to its Inkpod detail page', () => {
|
|
const product: Product = {
|
|
id: '12345', name: '测试商品', priority: 0, image: null, price: '28',
|
|
country: { id: '1', name: '美国', icon: null },
|
|
category: { id: '2', name: 'T恤', icon: null, parentId: null, children: [] },
|
|
tag: null, tags: [],
|
|
};
|
|
const wrapper = mount(ProductCard, { props: { product } });
|
|
const link = wrapper.get('a.product-card');
|
|
expect(link.attributes('href')).toBe('https://inkpod.vip/portal/detail/12345');
|
|
expect(link.attributes('target')).toBeUndefined();
|
|
});
|
|
});
|