8aab968e09
Build & Deploy / Build & Push Docker Image (push) Successful in 1m2s
Test / Type Check (all packages) (push) Failing after 28s
Test / API Unit Tests (push) Has been skipped
Test / Homepage Unit Tests (push) Has been skipped
Test / Storefront Unit Tests (push) Has been skipped
Test / Admin Unit Tests (push) Has been skipped
Test / Dashboard Unit Tests (push) Has been skipped
Test / API Integration Tests (push) Has been skipped
Build & Deploy / Deploy to VPS (push) Successful in 3s
Comprehensive rename of all marketplace references to storefront: - API module: apps/api/src/modules/marketplace/ → storefront/ - Components: MarketplaceHeader → StorefrontHeader, MarketplaceShell → StorefrontShell, MarketplaceFooter → StorefrontFooter - Types: marketplace-homepage.ts → storefront-homepage.ts - Test files: employee-marketplace-* → employee-storefront-* - All source code identifiers, imports, route paths, and strings - Documentation (docs/), CI config (.gitlab-ci.yml), scripts - Dashboard, admin, storefront workspace references - Prisma field names preserved (isListedOnMarketplace, marketplaceRating, marketplaceFunnelEvent) as they map to database schema Validation: - API type-check: 0 errors - Storefront type-check: 0 errors - Dashboard type-check: 0 errors - Full monorepo type-check: only pre-existing admin TS18046
33 lines
1.4 KiB
TypeScript
33 lines
1.4 KiB
TypeScript
import { describe, expect, it } from 'vitest'
|
|
import {
|
|
buildDashboardSignInHref,
|
|
companyInitial,
|
|
localeMenuPositionClass,
|
|
ownerWorkspaceHref,
|
|
} from './StorefrontHeader'
|
|
|
|
describe('StorefrontHeader helpers', () => {
|
|
it('builds dashboard sign-in links with language and theme query parameters', () => {
|
|
expect(buildDashboardSignInHref('https://app.example.com/dashboard', 'fr', 'dark')).toBe(
|
|
'https://app.example.com/dashboard/sign-in?lang=fr&theme=dark'
|
|
)
|
|
expect(buildDashboardSignInHref('/dashboard', 'ar', 'light')).toBe('/dashboard/sign-in?lang=ar&theme=light')
|
|
})
|
|
|
|
it('keeps the locale dropdown anchored to the readable side for RTL and LTR languages', () => {
|
|
expect(localeMenuPositionClass('ar')).toBe('right-0 sm:right-0')
|
|
expect(localeMenuPositionClass('en')).toBe('left-0 sm:left-auto sm:right-0')
|
|
expect(localeMenuPositionClass('fr')).toBe('left-0 sm:left-auto sm:right-0')
|
|
})
|
|
|
|
it('routes existing companies to their workspace and new owners to sign-up', () => {
|
|
expect(ownerWorkspaceHref('https://dashboard.example.com', 'Atlas Cars')).toBe('https://dashboard.example.com')
|
|
expect(ownerWorkspaceHref('https://dashboard.example.com', null)).toBe('https://dashboard.example.com/sign-up')
|
|
})
|
|
|
|
it('normalizes company initials for the owner workspace pill', () => {
|
|
expect(companyInitial('atlas cars')).toBe('A')
|
|
expect(companyInitial(' زاكورة كار ')).toBe('ز')
|
|
})
|
|
})
|