This commit is contained in:
Kalle
2026-08-16 11:05:12 +03:00
parent c0fdb922fd
commit e3e071b6a5
30 changed files with 3023 additions and 136 deletions

View File

@@ -139,7 +139,7 @@ function SegmentBar({
subWeaponId={params.subWeaponId}
specialWeaponId={params.specialWeaponId}
/>
<span className={styles.damageValue}>
<span data-testid="damage-value" className={styles.damageValue}>
{segment.damageValue}
{segment.count > 1 ? (
<span className={styles.hitMultiplier}>×{segment.count}</span>
@@ -148,6 +148,7 @@ function SegmentBar({
</div>
<button
type="button"
data-testid="damage-type-label"
className={styles.damageTypeLabel}
onClick={handleFilterClick}
>
@@ -179,7 +180,9 @@ function InkTimeSegment({
<Image path={abilityImageUrl("RES")} alt="" size={18} />
<span className={styles.inkTimeDamage}>{inkDamage.toFixed(1)}</span>
</div>
<div className={styles.inkTimeLabel}>{inkTimeFrames}f</div>
<div data-testid="ink-time-label" className={styles.inkTimeLabel}>
{inkTimeFrames}f
</div>
</div>
);
}
@@ -243,6 +246,7 @@ function FilteredItem({ filterKey, onRestore }: FilteredItemProps) {
return (
<button
type="button"
data-testid="filtered-item"
className={styles.filteredItem}
onClick={() => onRestore(filterKey)}
>
@@ -331,7 +335,7 @@ export function DamageComboList({ weaponIds }: DamageComboListProps) {
<span className={styles.collapseIcon}>{isCollapsed ? "+" : "-"}</span>
</button>
{isCollapsed ? null : (
<div className={styles.content}>
<div data-testid="damage-combo-content" className={styles.content}>
<div className={styles.slidersContainer}>
<Image path={abilityImageUrl("SRU")} alt="" size={24} />
<label className={styles.resSliderLabel}>

View File

@@ -40,7 +40,11 @@ export function ParamComparisonDialog({
>
<div className={styles.bars}>
{sortedEntries.map((entry) => (
<div key={entry.weaponId} className={styles.row}>
<div
key={entry.weaponId}
data-testid="comparison-bar-row"
className={styles.row}
>
<div className={styles.weapon}>
<WeaponParamImage kind={kind} id={entry.weaponId} size={28} />
<span className={styles.name}>{entry.name}</span>

View File

@@ -186,7 +186,11 @@ export function WeaponParamsTable({
const slug = naming.slug(weaponId);
return (
<th key={weaponId} className={clsx(styles.weaponHeader, {})}>
<th
key={weaponId}
data-testid="weapon-header"
className={clsx(styles.weaponHeader, {})}
>
<Link
to={weaponParamsPage(slug)}
className={styles.weaponHeaderContent}
@@ -247,11 +251,13 @@ export function WeaponParamsTable({
return (
<tr
key={fullKey}
data-testid={hasHistory ? "expandable-row" : undefined}
className={clsx({
[styles.expandableRow]: hasHistory,
})}
>
<td
data-testid="param-name"
className={styles.paramName}
onClick={
hasHistory ? () => toggleRow(fullKey) : undefined
@@ -434,9 +440,11 @@ function DamageRateInfoSection({
return (
<tr
key={fullKey}
data-testid={hasHistory ? "expandable-row" : undefined}
className={clsx({ [styles.expandableRow]: hasHistory })}
>
<td
data-testid="param-name"
className={styles.paramName}
onClick={hasHistory ? () => onToggle(fullKey) : undefined}
>
@@ -541,8 +549,12 @@ function SpecialPointsRow({
);
return (
<tr className={clsx({ [styles.expandableRow]: hasHistory })}>
<tr
data-testid={hasHistory ? "expandable-row" : undefined}
className={clsx({ [styles.expandableRow]: hasHistory })}
>
<td
data-testid="param-name"
className={styles.paramName}
onClick={hasHistory ? onToggle : undefined}
>
@@ -605,7 +617,9 @@ function SpecialPointCell({
))}
</div>
{kitsWithHistory.length > 0 && !isExpanded ? (
<span className={styles.historyBadge}>{kitsWithHistory.length}</span>
<span data-testid="history-badge" className={styles.historyBadge}>
{kitsWithHistory.length}
</span>
) : null}
</div>
{showHistory ? (
@@ -659,7 +673,9 @@ function ParamCell({
{WeaponParams.formatValue(param.current)}
</span>
{param.history.length > 0 && !isExpanded ? (
<span className={styles.historyBadge}>{param.history.length}</span>
<span data-testid="history-badge" className={styles.historyBadge}>
{param.history.length}
</span>
) : null}
</div>
{showHistory ? (

View File

@@ -54,7 +54,11 @@ export function WeaponPatchHistory({ patches }: { patches: WeaponPatch[] }) {
return (
<div className={styles.container}>
{patches.map((patch) => (
<div key={patch.version} className={styles.column}>
<div
key={patch.version}
data-testid="patch-column"
className={styles.column}
>
<PatchColumnHeader version={patch.version} date={patch.date} />
<div className={styles.changes}>
{patch.changes.map((change, i) => (
@@ -185,7 +189,7 @@ function KitPatchColumn({
);
return (
<div className={styles.column}>
<div data-testid="patch-column" className={styles.column}>
<PatchColumnHeader version={patch.version} date={patch.date} />
<div className={styles.changes}>
{mainChanges.map((change, i) => (