ui changes and cs prices
All checks were successful
Test and deploy staging / staging (push) Successful in 11m52s
All checks were successful
Test and deploy staging / staging (push) Successful in 11m52s
This commit is contained in:
48
src/lib/cs-prices/taxonomy.test.ts
Normal file
48
src/lib/cs-prices/taxonomy.test.ts
Normal file
@@ -0,0 +1,48 @@
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import { dimensionsFromName } from './taxonomy';
|
||||
|
||||
describe('CS market dimensions', () => {
|
||||
it('groups normal and StatTrak wear variants under the same gun and skin', () => {
|
||||
const normal = dimensionsFromName('AK-47 | Redline (Field-Tested)');
|
||||
const stattrak = dimensionsFromName('StatTrak™ AK-47 | Redline (Minimal Wear)');
|
||||
expect(normal).toMatchObject({
|
||||
category: 'weapon',
|
||||
weapon_type: 'rifle',
|
||||
weapon: 'AK-47',
|
||||
skin: 'Redline',
|
||||
weapon_skin: 'AK-47 | Redline',
|
||||
wear: 'Field-Tested',
|
||||
stattrak: 'no'
|
||||
});
|
||||
expect(stattrak).toMatchObject({
|
||||
category: 'weapon',
|
||||
weapon_type: 'rifle',
|
||||
weapon: 'AK-47',
|
||||
skin: 'Redline',
|
||||
wear: 'Minimal Wear',
|
||||
stattrak: 'yes'
|
||||
});
|
||||
});
|
||||
|
||||
it('recognizes knives, gloves, souvenir weapons, and non-weapon entries', () => {
|
||||
expect(dimensionsFromName('★ Karambit | Doppler (Factory New)')).toMatchObject({
|
||||
category: 'knife',
|
||||
weapon: 'Karambit',
|
||||
skin: 'Doppler'
|
||||
});
|
||||
expect(dimensionsFromName('★ Sport Gloves | Vice (Field-Tested)')).toMatchObject({
|
||||
category: 'gloves',
|
||||
weapon: 'Sport Gloves'
|
||||
});
|
||||
expect(dimensionsFromName('Souvenir AWP | Dragon Lore (Factory New)')).toMatchObject({
|
||||
weapon: 'AWP',
|
||||
souvenir: 'yes'
|
||||
});
|
||||
expect(dimensionsFromName('Sticker | Crown (Foil)')).toMatchObject({
|
||||
category: 'sticker',
|
||||
skin: 'Crown',
|
||||
variant: 'Foil'
|
||||
});
|
||||
expect(dimensionsFromName('Revolution Case')).toMatchObject({ category: 'container' });
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user