SOURCE CODE: Uize.Test.Uize.Loc.Pseudo.Xml (view docs)

/*______________
|       ______  |   U I Z E    J A V A S C R I P T    F R A M E W O R K
|     /      /  |   ---------------------------------------------------
|    /    O /   |    MODULE : Uize.Test.Uize.Loc.Pseudo.Xml Class
|   /    / /    |
|  /    / /  /| |    ONLINE : http://uize.com
| /____/ /__/_| | COPYRIGHT : (c)2015-2016 UIZE
|          /___ |   LICENSE : Available under MIT License or GNU General Public License
|_______________|             http://uize.com/license.html
*/

/* Module Meta Data
  type: Test
  importance: 1
  codeCompleteness: 100
  docCompleteness: 100
*/

/*?
  Introduction
    The =Uize.Test.Uize.Loc.Pseudo.Xml= module defines a suite of unit tests for the =Uize.Loc.Pseudo.Xml= module.

    *DEVELOPERS:* `Chris van Rensburg`
*/

Uize.module ({
  name:'Uize.Test.Uize.Loc.Pseudo.Xml',
  builder:function () {
    'use strict';

    return Uize.Test.resolve ({
      title:'Test for Uize.Loc.Pseudo.Xml Module',
      test:[
        Uize.Test.requiredModulesTest ('Uize.Loc.Pseudo.Xml'),
        Uize.Test.staticMethodsTest ([
          ['Uize.Loc.Pseudo.Xml.pseudoLocalize',[
            ['The content from all text nodes is pseudo-localized, while tags are left as is',
              [
                '
' + '
Main Menu
' + '
' + 'This is the awesome body content' + '
' + '
(c) Copyright 3001
' + '
', {wrapper:''} ], '
' + '
Ṁåîñ_ Ṁéñû_
' + '
' + 'Ţĥîš__ îš ţĥé_ åŵéšöɱé__ ƀöðý_ çöñţéñţ___' + '
' + '
(ç) Çöþýŕîĝĥţ___ 3001_
' + '
' ], ['HTML entities that represent non-word characters are not modified by pseudo-localization', [ '
<>&
', {wrapper:''} ], '
<>&
' ], ['HTML entities that represent word characters are pseudo-localized in the same way as the non-entity (i.e. regular) representations of those characters', [ '
foo bar
', {wrapper:''} ], '
ƒöö_ ƀåŕ_
' ], ['When no attribute matcher is specified, then no attributes will be pseudo-localized', [ '
' + '
Main Menu
' + '
' + 'This is the awesome body content' + '
' + '' + '
', {wrapper:''} ], '
' + '
Ṁåîñ_ Ṁéñû_
' + '
' + 'Ţĥîš__ îš ţĥé_ åŵéšöɱé__ ƀöðý_ çöñţéñţ___' + '
' + '' + '
' ], ['When an optional attribute matcher is specified, those attributes that match against the attribute matcher will be pseudo-localized, while attributes that do not match will not be pseudo-localized', [ '
' + '
Main Menu
' + '
' + 'This is the awesome body content' + 'This is an image' + '' + '' + '
' + '' + '
', { attributeMatcher:[ 'title', 'img@alt', '[input|textarea]@placeholder' ], wrapper:'' } ], '
' + '
Ṁåîñ__ Ṁéñû_
' + '
' + 'Ţĥîš_ îš_ ţĥé_ åŵéšöɱé__ ƀöðý_ çöñţéñţ__' + 'Ţĥîš_ îš_ åñ îɱåĝé__' + '' + '' + '
' + '' + '
' ] ]] ]) ] }); } });