The opt-out makes no sense, unless it's opted in before you opt it out. But opt-in is not the default in Template space, so we add param |demospace=1 to simulate the correct namespace so it would be included, then use the opt-out params to hide it again.
Expand to view description of how to run these tests
These are external tests that rely on using {{Talk header/sandbox}} transcluding the "Find sources" wrapper template ({{Find sources/sandbox}} to choose the right domain-specific "find sources" template from among medical, video game, or general sources (and possibly others). Because these tests depend on using the WikiProjects listed in the Talk header template at the top of an article page, they cannot be tested in the normal way.
Methodology: ExpandTemplates or in situ
The test cases can be performed either at Special:ExpandTemplates, or in situ at the Talk pages of actual articles which have the appropriate WikiProject listings already present, in Preview Mode. The easier method is probably to use ExpandTemplates.
The other method is an in situ test. All of the 'tests in this section may be performed in situ in the following way:
edit the Talk page of an article belonging to one or more WikiProjects detected by the template
find the transclusion of template {{talk header}} (normally at the top of the Talk page; or add one)
change it to {{talk header/sandbox}} (+ optional params; see individual test cases below)
click "Preview" button and observe the "find sources" links that are generated in the Talk header
if the observed links match the "expected result" given in the test case, it's a "pass", otherwise, "fail".
Any article Talk page with the correct header and projects may be used for this; the lists in the Test cases defined below contains some suggested Talk pages with the correct WikiProjects on them to perform the test case. After viewing the test case result in Preview mode on the page, it's best to cancel out and not save the altered page.
Note: the articles above only test the autodection feature for articles which transclude the wikiproject under its original name 'WikiProject Medicine' and without using a redirect. Complete testing of this feature requires testing some Talk pages of articles that incorporate a redirect to project Medicine. See test E-2a below for a selection of these.
For an additional list of sample articles employing redirects to project Medicine to use for testing, please see test B-2 here.
E-2a Articles using redirects to WikiProject Medicine
E-2a Articles using redirects to WikiProject Medicine
There are 15 redirects to WikiProject Medicine. Not all of them are in use on article Talk pages. A couple that are, include {{WPMED}} (hundreds of transclusions),
E-4 Project priority: articles that include multiple projects
E-4 Project priority
articles that include multiple projects
This test may be performed using ExpandTemplates or in situ testing. (see Methodology)
These tests verify that the correct set of find sources links are displayed, for articles belonging to more than one project.
Use {{Find sources/sandbox}}
Expected result: these should display links matching the {{find * sources}} template corresponding to the search domain of the highest priority project on the page.
As of 1 Nov 2021, the priority sequence is: 1. medical, 2. video games, 3. general (legacy links). (Other domains like biographical and military are on the list for possible expansion of the template.) Further examples can be found using Petscan.
E-4a – medical & biographical
E-4a – medical & biographical:
This test may be performed using ExpandTemplates or in situ testing. (see Methodology)
Expected result: Medical links (results match {{find medical sources}})
Expand to view description of how to run these tests
Please read the instructions in section #E. WikiProject detection first, to understand how they are set up, including how to execute a test case either by using Special:ExpandTemplates, or by using an in situ test.
As in that section, because the tests below depend on overriding the WikiProjects listed in the Talk header template at the top of an article page, they cannot be fully tested in the normal way. These tests may be performed in two ways: in situ, or via Special:ExpandTemplates. Where tests in this section differ from the test cases in the previous section, is that in these tests, we include a |domain= param to override the WikiProject(s) detected by the template.
Here is an example of testing with ExpandTemplates, to override a video game Talk page with medical source links in the Talk header:
3. Expected result: although this is not a member of project Medicine, the links displayed match {{find medical sources}}.
The other way to execute a test case, is in situ: add a Talk header with a |domain= param to the Talk pages of actual articles which have the appropriate Talk page headers and WikiProject listings (without saving):
edit the Talk page header of an article belonging to, say, WikiProject medicine
find the transclusion of {{talk header}} (normally at the top of the page)
change it to (or add:) {{talk header/sandbox}}, hit Preview, and take note of the "find sources" links that are generated
execute a set of domain override tests on this page:
change the header to {{talk header/sandbox|domain=medical}} (or med) and Preview
observe that the find sources links in the Talk header change to those of {{find medical sources}}
change the header to {{talk header/sandbox|domain=video}} (vg or video game) and Preview
observe that the find sources links in the Talk header change to those of {{find video game sources}}
change the header to {{talk header/sandbox|domain=general}} or (gen and Preview
observe that the find sources links in the Talk header change to those of the default set: {{find general sources}}
Any article Talk page may be used for these tests; for suggested articles, see the list in test section #E. WikiProject detection above, which contains some suggested Talk pages with the correct WikiProjects on it to autodetect a project, and to override it using the |domain= param, and observe the results. After viewing the test case result in Preview mode on the page, it's best to just cancel out and not save the Previewed page.
Find sources links should only be emitted in the Talk header, when the template is placed on article talk pages (ns:1) or Draft talk pages (ns:119). In any other namespace, no find sources are emitted.
Expand to view description of how to run these tests
paste one of the suggested 'Draft talk:' pages into 'Context Title'
paste the following text the input wikitext box: {{Talk header}}
Expected result: the Talk header template displayed by ExpandTemplates should show find sources links which search for the Context title
The other way to execute a test case, is in situ:
find a Draft talk page and open it for editing
find the transclusion of {{talk header}} (normally at the top of the page)
change it to (or add one if it doesn't have it:) {{talk header}}, and hit Preview
Expected result: "find sources" links are found in the Talk header box for the page
Any Draft talk page may be used for these tests. After viewing the test case result in Preview mode on the page, it's best to just cancel out and not save the Previewed page.
The alternative, is to test the subtemplate directly, using the two-param method, passing the name of the Talk page in param 2. These tests follow:
-->