From 74f3e5a04088b5059e7587b71b15ba57cca61bc2 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Thu, 15 Aug 2024 13:07:42 -0300 Subject: content, test: linkContribution: showContribution -> showAnnotation --- src/content/dependencies/generateContributionList.js | 2 +- .../dependencies/generateReleaseInfoContributionsLine.js | 4 ++-- .../generateReleaseInfoContributionsLineWikiEditsPart.js | 5 ++--- src/content/dependencies/linkContribution.js | 8 ++++---- tap-snapshots/test/snapshot/linkContribution.js.test.cjs | 4 ++-- test/snapshot/linkContribution.js | 10 +++++----- test/unit/content/dependencies/linkContribution.js | 4 ++-- 7 files changed, 18 insertions(+), 19 deletions(-) diff --git a/src/content/dependencies/generateContributionList.js b/src/content/dependencies/generateContributionList.js index 8e8c5020..d1c3de0f 100644 --- a/src/content/dependencies/generateContributionList.js +++ b/src/content/dependencies/generateContributionList.js @@ -20,8 +20,8 @@ export default { .map(contributionLink => html.tag('li', contributionLink.slots({ + showAnnotation: true, showExternalLinks: true, - showContribution: true, showChronology: true, preventWrapping: false, chronologyKind: slots.chronologyKind, diff --git a/src/content/dependencies/generateReleaseInfoContributionsLine.js b/src/content/dependencies/generateReleaseInfoContributionsLine.js index ee817f08..195b94f3 100644 --- a/src/content/dependencies/generateReleaseInfoContributionsLine.js +++ b/src/content/dependencies/generateReleaseInfoContributionsLine.js @@ -34,7 +34,7 @@ export default { }), slots: { - showContribution: {type: 'boolean', default: true}, + showAnnotation: {type: 'boolean', default: true}, showExternalLinks: {type: 'boolean', default: true}, showChronology: {type: 'boolean', default: true}, @@ -47,7 +47,7 @@ export default { language.formatConjunctionList( relations.contributionLinks.map(link => link.slots({ - showContribution: slots.showContribution, + showAnnotation: slots.showAnnotation, showExternalLinks: slots.showExternalLinks, showChronology: slots.showChronology, chronologyKind: slots.chronologyKind, diff --git a/src/content/dependencies/generateReleaseInfoContributionsLineWikiEditsPart.js b/src/content/dependencies/generateReleaseInfoContributionsLineWikiEditsPart.js index 37f29b1c..c5c52fa0 100644 --- a/src/content/dependencies/generateReleaseInfoContributionsLineWikiEditsPart.js +++ b/src/content/dependencies/generateReleaseInfoContributionsLineWikiEditsPart.js @@ -39,9 +39,8 @@ export default { language.$(capsule, 'editsLine', { artist: link.slots({ - showContribution: false, - showExternalLinks: false, - showChronology: false, + showAnnotation: true, + trimAnnotation: true, preventTooltip: true, }), })), diff --git a/src/content/dependencies/linkContribution.js b/src/content/dependencies/linkContribution.js index 67451093..0c5ec8f4 100644 --- a/src/content/dependencies/linkContribution.js +++ b/src/content/dependencies/linkContribution.js @@ -19,12 +19,12 @@ export default { }), data: (contribution) => ({ - contribution: contribution.annotation, + annotation: contribution.annotation, urls: contribution.artist.urls, }), slots: { - showContribution: {type: 'boolean', default: false}, + showAnnotation: {type: 'boolean', default: false}, showExternalLinks: {type: 'boolean', default: false}, showChronology: {type: 'boolean', default: false}, @@ -67,10 +67,10 @@ export default { relations.tooltip, })); - if (slots.showContribution && data.contribution) { + if (slots.showAnnotation && data.annotation) { workingCapsule += '.withContribution'; workingOptions.contrib = - data.contribution; + data.annotation; } return language.formatString(workingCapsule, workingOptions); diff --git a/tap-snapshots/test/snapshot/linkContribution.js.test.cjs b/tap-snapshots/test/snapshot/linkContribution.js.test.cjs index a9ac916e..0c44a85c 100644 --- a/tap-snapshots/test/snapshot/linkContribution.js.test.cjs +++ b/tap-snapshots/test/snapshot/linkContribution.js.test.cjs @@ -73,7 +73,7 @@ exports[`test/snapshot/linkContribution.js > TAP > linkContribution (snapshot) > Other (Arrangement) ` -exports[`test/snapshot/linkContribution.js > TAP > linkContribution (snapshot) > only showContribution 1`] = ` +exports[`test/snapshot/linkContribution.js > TAP > linkContribution (snapshot) > only showAnnotation 1`] = ` Clark Powell Grounder & Scratch (Snooping) Toby Fox (Arrangement) @@ -98,7 +98,7 @@ exports[`test/snapshot/linkContribution.js > TAP > linkContribution (snapshot) > Other ` -exports[`test/snapshot/linkContribution.js > TAP > linkContribution (snapshot) > showContribution & showExternalLinks 1`] = ` +exports[`test/snapshot/linkContribution.js > TAP > linkContribution (snapshot) > showAnnotation & showExternalLinks 1`] = ` Clark Powell plazmataz diff --git a/test/snapshot/linkContribution.js b/test/snapshot/linkContribution.js index 5844b0b9..47ef1503 100644 --- a/test/snapshot/linkContribution.js +++ b/test/snapshot/linkContribution.js @@ -33,13 +33,13 @@ testContentFunctions(t, 'linkContribution (snapshot)', async (t, evaluate) => { slots, }); - quickSnapshot('showContribution & showExternalLinks', { - showContribution: true, + quickSnapshot('showAnnotation & showExternalLinks', { + showAnnotation: true, showExternalLinks: true, }); - quickSnapshot('only showContribution', { - showContribution: true, + quickSnapshot('only showAnnotation', { + showAnnotation: true, }); quickSnapshot('only showExternalLinks', { @@ -66,7 +66,7 @@ testContentFunctions(t, 'linkContribution (snapshot)', async (t, evaluate) => { }); quickSnapshot('no preventWrapping', { - showContribution: true, + showAnnotation: true, showExternalLinks: true, preventWrapping: false, }); diff --git a/test/unit/content/dependencies/linkContribution.js b/test/unit/content/dependencies/linkContribution.js index e7a29310..3ffd71d2 100644 --- a/test/unit/content/dependencies/linkContribution.js +++ b/test/unit/content/dependencies/linkContribution.js @@ -26,7 +26,7 @@ t.test('generateContributionLinks (unit)', async t => { await testContentFunctions(t, 'generateContributionLinks (unit 1)', async (t, evaluate) => { const slots = { - showContribution: true, + showAnnotation: true, showExternalLinks: true, }; @@ -81,7 +81,7 @@ t.test('generateContributionLinks (unit)', async t => { await testContentFunctions(t, 'generateContributionLinks (unit 2)', async (t, evaluate) => { const slots = { - showContribution: false, + showAnnotation: false, showExternalLinks: false, }; -- cgit 1.3.0-6-gf8a5