diff --git a/src/index.html b/src/index.html
index 78bc567..bd11825 100644
--- a/src/index.html
+++ b/src/index.html
@@ -47,7 +47,7 @@
show-catalog-nb-tags="${SHOW_CATALOG_NB_TAGS}"
history-custom-labels="${HISTORY_CUSTOM_LABELS}"
use-control-cache-header="${USE_CONTROL_CACHE_HEADER}"
- taglist-order="${TAGLIST_ORDER}
+ taglist-order="${TAGLIST_ORDER}"
theme="${THEME}"
theme-primary-text="${THEME_PRIMARY_TEXT}"
theme-neutral-text="${THEME_NEUTRAL_TEXT}"
@@ -74,7 +74,7 @@
show-catalog-nb-tags="true"
history-custom-labels="first_custom_labels,second_custom_labels"
use-control-cache-header="false"
- taglist-order="alpha-asc;num-desc"
+ taglist-order=""
theme="auto"
theme-primary-text=""
theme-neutral-text=""
diff --git a/src/scripts/taglist-order.js b/src/scripts/taglist-order.js
index 2d83de9..8b9f7df 100644
--- a/src/scripts/taglist-order.js
+++ b/src/scripts/taglist-order.js
@@ -16,7 +16,7 @@ export const taglistOrderVariants = (taglistOrder) => {
return `${taglistOrder};${taglistOrder.startsWith('num') ? 'alpha' : 'num'}-asc`;
default:
if (!taglistOrder) {
- return 'num-asc;alpha-asc';
+ return 'alpha-asc;num-desc';
} else if (TAGLIST_ORDER_REGEX.test(taglistOrder)) {
return taglistOrder;
}
diff --git a/test/taglist-order.test.js b/test/taglist-order.test.js
index 3aaf8a4..12f42ed 100644
--- a/test/taglist-order.test.js
+++ b/test/taglist-order.test.js
@@ -15,9 +15,14 @@ describe('utils tests', () => {
expected.forEach((e) => assert.deepEqual(taglistOrderVariants(e), e));
});
+ it('should return correct default order', () => {
+ const expected = 'alpha-asc;num-desc';
+ [undefined, ''].forEach((e) => assert.deepEqual(taglistOrderVariants(e), expected));
+ });
+
it('should return correct variant of `num-asc;alpha-asc`', () => {
const expected = 'num-asc;alpha-asc';
- [undefined, '', 'asc', 'num-asc'].forEach((e) => assert.deepEqual(taglistOrderVariants(e), expected));
+ ['asc', 'num-asc'].forEach((e) => assert.deepEqual(taglistOrderVariants(e), expected));
});
it('should return correct variant of `alpha-desc;num-desc`', () => {
@@ -39,7 +44,7 @@ describe('utils tests', () => {
describe('taglistOrderParser', () => {
it('should have default configuration when empty or undefined', () => {
- const expected = { numAsc: true, alphaAsc: true, numFirst: true };
+ const expected = { numAsc: false, alphaAsc: true, numFirst: false };
assert.deepEqual(taglistOrderParser(), expected);
assert.deepEqual(taglistOrderParser(''), expected);
});