Files
inkreach-official-website/apps/website/test/ProductCard.test.ts
T
yeuimu 79fabd85f7 feat(product-center): implement Figma-designed UI, upload module, and website tests
- 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
2026-08-20 14:32:03 +08:00

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();
});
});