- 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
68 lines
No EOL
1.6 KiB
JavaScript
68 lines
No EOL
1.6 KiB
JavaScript
/* global describe,it */
|
|
|
|
var getSlug = require('../lib/speakingurl');
|
|
|
|
describe('getSlug smart truncate', function () {
|
|
'use strict';
|
|
|
|
it('should maintain case characters, with smart truncate', function (done) {
|
|
|
|
getSlug('Foobarbaz, Bar Baz', {
|
|
truncate: 12
|
|
})
|
|
.should.eql('foobarbaz');
|
|
|
|
getSlug('Foobarbaz, Bar Baz', {
|
|
truncate: 15
|
|
})
|
|
.should.eql('foobarbaz-bar');
|
|
|
|
getSlug(' Foobarbaz, Bar Baz', {
|
|
truncate: 15
|
|
})
|
|
.should.eql('foobarbaz-bar');
|
|
|
|
getSlug(' Foobarbaz, Bar Baz', {
|
|
truncate: 15
|
|
})
|
|
.should.eql('foobarbaz-bar');
|
|
|
|
getSlug('Foo Foo bar Zoo Bar Baz', {
|
|
truncate: 15
|
|
})
|
|
.should.eql('foo-foo-bar-zoo');
|
|
|
|
getSlug('Foo Foo bar ZooBar Baz', {
|
|
truncate: 15
|
|
})
|
|
.should.eql('foo-foo-bar');
|
|
|
|
getSlug('Foo Foo bar ZooBar Baz', {
|
|
truncate: 15
|
|
})
|
|
.should.eql('foo-foo-bar');
|
|
|
|
getSlug('Foo Foo Bar Bar', {
|
|
truncate: "foo"
|
|
})
|
|
.should.eql('foo-foo-bar-bar');
|
|
|
|
getSlug('Foo Foo Bar Bar', {
|
|
truncate: false
|
|
})
|
|
.should.eql('foo-foo-bar-bar');
|
|
|
|
getSlug('Foo Foo Bar Bar', {
|
|
truncate: true
|
|
})
|
|
.should.eql('foo-foo-bar-bar');
|
|
|
|
getSlug('a Foo', {
|
|
truncate: true
|
|
})
|
|
.should.eql('a-foo');
|
|
|
|
done();
|
|
|
|
});
|
|
}); |