Skip to content

Commit

Permalink
core: place WPAFC banner first (wikimedia-gadgets#372)
Browse files Browse the repository at this point in the history
requested at WT:AFC for historical reasons
  • Loading branch information
NovemLinguae authored and ptsgrn committed Dec 5, 2024
1 parent 065c92f commit 723fe84
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
5 changes: 3 additions & 2 deletions src/modules/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -1675,8 +1675,9 @@
// trim. makes unit tests more stable
wikicode = wikicode.trim();

// add AFC banner to array
banners.push(
// Add AFC banner to array.
// Put at top for historical reasons. People are used to it being there.
banners.unshift(
'{{subst:WPAFC/article|class=' + newAssessment +
( revId ? '|oldid=' + revId : '' ) +
'}}'
Expand Down
18 changes: 9 additions & 9 deletions tests/test-core.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,8 @@ I have a question. Can you help answer it? –[[User:Novem Linguae|<span style="
var output = AFCH.addTalkPageBanners( wikicode, newAssessment, revId, isBiography, newWikiProjects, lifeStatus, subjectName );
expect( output ).toBe(
`{{WikiProject banner shell|
{{WikiProject Women}}
{{subst:WPAFC/article|oldid=592485}}
{{WikiProject Women}}
}}
{{translated page|ar|بحيرة كناو|version=|small=no|insertversion=|section=}}`
);
Expand All @@ -194,8 +194,8 @@ I have a question. Can you help answer it? –[[User:Novem Linguae|<span style="
var output = AFCH.addTalkPageBanners( wikicode, newAssessment, revId, isBiography, newWikiProjects, lifeStatus, subjectName );
expect( output ).toBe(
`{{WikiProject banner shell|
{{WikiProject Women}}
{{subst:WPAFC/article|oldid=592485}}
{{WikiProject Women}}
}}
{{translated page|ar|بحيرة كناو|version=|small=no|insertversion=|section=}}`
);
Expand All @@ -213,8 +213,8 @@ I have a question. Can you help answer it? –[[User:Novem Linguae|<span style="
var output = AFCH.addTalkPageBanners( wikicode, newAssessment, revId, isBiography, newWikiProjects, lifeStatus, subjectName );
expect( output ).toBe(
`{{WikiProject banner shell|
{{WikiProject Women}}
{{subst:WPAFC/article|oldid=592485}}
{{WikiProject Women}}
}}`
);
} );
Expand All @@ -233,10 +233,10 @@ I have a question. Can you help answer it? –[[User:Novem Linguae|<span style="
var output = AFCH.addTalkPageBanners( wikicode, newAssessment, revId, isBiography, newWikiProjects, lifeStatus, subjectName );
expect( output ).toBe(
`{{WikiProject banner shell|
{{subst:WPAFC/article|oldid=592507}}
{{WikiProject Women}}
{{WikiProject Women's sport}}
{{WikiProject Somalia}}
{{subst:WPAFC/article|oldid=592507}}
}}`
);
} );
Expand All @@ -257,10 +257,10 @@ I have a question. Can you help answer it? –[[User:Novem Linguae|<span style="
var output = AFCH.addTalkPageBanners( wikicode, newAssessment, revId, isBiography, newWikiProjects, lifeStatus, subjectName );
expect( output ).toBe(
`{{WikiProject banner shell|
{{subst:WPAFC/article|oldid=592507}}
{{WikiProject Women}}
{{WikiProject Women's sport}}
{{WikiProject Somalia}}
{{subst:WPAFC/article|oldid=592507}}
}}`
);
} );
Expand All @@ -282,10 +282,10 @@ I have a question. Can you help answer it? –[[User:Novem Linguae|<span style="
var output = AFCH.addTalkPageBanners( wikicode, newAssessment, revId, isBiography, newWikiProjects, lifeStatus, subjectName );
expect( output ).toBe(
`{{WikiProject banner shell|
{{subst:WPAFC/article|oldid=592507}}
{{WikiProject Film}}
{{WikiProject Women}}
{{WikiProject Television}}
{{subst:WPAFC/article|oldid=592507}}
{{WikiProject Biography|living=yes|listas=Lazarut, Raluca}}
{{WikiProject Romania}}
}}`
Expand All @@ -308,10 +308,10 @@ I have a question. Can you help answer it? –[[User:Novem Linguae|<span style="
var output = AFCH.addTalkPageBanners( wikicode, newAssessment, revId, isBiography, newWikiProjects, lifeStatus, subjectName );
expect( output ).toBe(
`{{WikiProject banner shell|
{{subst:WPAFC/article|oldid=592507}}
{{WikiProject Women}}
{{WikiProject Women's sport}}
{{WikiProject Somalia}}
{{subst:WPAFC/article|oldid=592507}}
}}`
);
} );
Expand Down Expand Up @@ -366,8 +366,8 @@ I have a question. Can you help answer it? –[[User:Novem Linguae|<span style="
var output = AFCH.addTalkPageBanners( wikicode, newAssessment, revId, isBiography, newWikiProjects, lifeStatus, subjectName );
expect( output ).toBe(
`{{WikiProject banner shell|
{{WikiProject Somalia}}
{{subst:WPAFC/article|oldid=592496}}
{{WikiProject Somalia}}
}}`
);
} );
Expand Down Expand Up @@ -401,8 +401,8 @@ I have a question. Can you help answer it? –[[User:Novem Linguae|<span style="
var output = AFCH.addTalkPageBanners( wikicode, newAssessment, revId, isBiography, newWikiProjects, lifeStatus, subjectName );
expect( output ).toBe(
`{{WikiProject banner shell|
{{OKA}}
{{subst:WPAFC/article|oldid=592681}}
{{OKA}}
}}
{{translated page|pl|Katowice Załęże|version=|small=no|insertversion=|section=}}`
);
Expand Down

0 comments on commit 723fe84

Please sign in to comment.