- web/: Vue 3 + Vite + UnoCSS + Pinia, dark tactical theme (amber/#0d1117) - AppNav, ListingCard, SearchView with filters/sort, composables (useSnipeMode, useKonamiCode, useMotion), Pinia search store - Steal shimmer, auction countdown, Snipe Mode easter egg all native in Vue - docker/web/: nginx + multi-stage Dockerfile (node build → nginx serve) - compose.yml: api (8510) + web (8509) services - Dockerfile CMD updated to uvicorn for upcoming FastAPI layer - Clean build: 0 TS errors, 380 modules
98 lines
No EOL
2.4 KiB
JavaScript
98 lines
No EOL
2.4 KiB
JavaScript
/* global describe,it */
|
||
|
||
var getSlug = require('../lib/speakingurl');
|
||
|
||
describe('getSlug with custom replacement', function () {
|
||
'use strict';
|
||
|
||
it('should be transliterated', function (done) {
|
||
|
||
getSlug('буу', {
|
||
lang: false,
|
||
custom: {
|
||
'б': 'б',
|
||
'у': 'у'
|
||
}
|
||
})
|
||
.should.eql('буу');
|
||
|
||
getSlug('[nodejs]', {
|
||
custom: {
|
||
'[': '[',
|
||
']': ']'
|
||
}
|
||
})
|
||
.should.eql('[nodejs]');
|
||
|
||
getSlug('[Äpfel]', {
|
||
custom: {
|
||
'[': '[',
|
||
']': ']'
|
||
}
|
||
})
|
||
.should.eql('[aepfel]');
|
||
|
||
getSlug('[Äpfel]', {
|
||
lang: false,
|
||
custom: {
|
||
'[': '[',
|
||
']': ']'
|
||
}
|
||
})
|
||
.should.eql('[aepfel]');
|
||
|
||
done();
|
||
});
|
||
|
||
it('should be extended with allowed chars', function (done) {
|
||
|
||
getSlug('буу', {
|
||
custom: ['б', 'у']
|
||
})
|
||
.should.eql('буу');
|
||
|
||
getSlug('[Knöpfe]', {
|
||
custom: ['[', ']']
|
||
})
|
||
.should.eql('[knoepfe]');
|
||
|
||
getSlug('[Knöpfe & Ösen]', {
|
||
custom: ['[', ']']
|
||
})
|
||
.should.eql('[knoepfe-and-oesen]');
|
||
|
||
getSlug('[Knöpfe & Ösen]', {
|
||
custom: ['[', ']'],
|
||
lang: 'de'
|
||
})
|
||
.should.eql('[knoepfe-und-oesen]');
|
||
|
||
getSlug('[Knöpfe]', {
|
||
maintainCase: true,
|
||
custom: ['[', ']']
|
||
})
|
||
.should.eql('[Knoepfe]');
|
||
|
||
getSlug('[Knöpfe haben Löcher]', {
|
||
titleCase: true,
|
||
custom: ['[', ']']
|
||
})
|
||
.should.eql('[Knoepfe-Haben-Loecher]');
|
||
|
||
getSlug('[knöpfe haben runde löcher]', {
|
||
titleCase: ['haben', 'runde'],
|
||
custom: ['[', ']']
|
||
})
|
||
.should.eql('[Knoepfe-haben-runde-Loecher]');
|
||
|
||
getSlug('[knöpfe haben runde löcher]', {
|
||
titleCase: ['haben', 'runde'],
|
||
maintainCase: true,
|
||
custom: ['[', ']']
|
||
})
|
||
.should.eql('[Knoepfe-haben-runde-Loecher]');
|
||
|
||
done();
|
||
});
|
||
|
||
}); |