User:PerfektesChaos/js/fragmentAnchors/Test

Test cases for fragmentAnchors gadget.

Installation Check

 * 1) Follow the instructions at fragmentAnchors #Usage.
 * 2) Open any page, or reload this test page.
 * 3) Find a Anchor pictogram.svg link in tool box (usually in left column of portal) and click.

Correct Anchors
Within this text  a should appear now.
 * Hover on the symbol: A bubble above tells you „insertion“.
 * Click on the symbol: A bubble below tells you.
 * Click once again and the bubble vanishes.

Multiple Anchors
If the same identifier is provided multiple times, only the first one could be addressed and any other is unreachable. Both should be marked with a red symbol on yellow square now. On top of the page this is reported in a red box by 2× #twice item. The behaviour on mouse action is the same as with correct anchors.
 * 1) An identifier   was given in this line …
 * 2) … and here again.
 * An empty identifier is meaningless and regarded as duplication of the entire document address, reported above by 1× # item.

Missing Anchors
On page view (not editing) it will be checked whether there is a target for every internal link.
 * This link points correctly to top of the page.
 * This link points to nirvana which was not found; at least not within this page. It is decorated by # ahead and reported by −1× #nirvana item.

Uncertain target
In section „Multiple Anchors“  has been declared twice. If this will be distinguished, it is still unclear which link should point to which location and which links should be renamed.
 * A link to „twice“ is decorated by # ahead and reported by −1× #twice item.

Strange Anchors
Identifiers to be avoided receive a red anchor symbol. The hover bubble shows text in red colour on yellow background.
 * A hash  inside is confusing.
 * A percent  inside could be mixed up with URL encoding.
 * A fragment should best start with letter, but at least not with digits like 42.
 * Two question marks  in fragment might indicate a detected error situation.

Structural error summary
At page top a summary should list structural errors – for the current page:
 * 2× #twice
 * 1× #
 * −1× #nirvana
 * −1× #twice