@@ -266,7 +266,7 @@ describe('ThPageLoginBaseComponent: ', () => {
266266
267267 } ) ;
268268
269- it ( 'p-literals: should set `constainsLiterals ` with true if `literals.title` and `literalsDefault.title ` don`t match' , ( ) => {
269+ it ( 'p-literals: should set `containsCustomLiterals ` with true if `literals.title` and `literalsDefault.loginHint ` don`t match' , ( ) => {
270270 component [ '_literals' ] = { title : 'Title' , loginHint : poPageLoginLiteralsDefault [ poLocaleDefault ] . loginHint } ;
271271 component . selectedLanguage = poLocaleDefault ;
272272 const validLiterals = component [ '_literals' ] ;
@@ -279,7 +279,19 @@ describe('ThPageLoginBaseComponent: ', () => {
279279
280280 } ) ;
281281
282- it ( 'p-literals: should set `constainsLiterals` with false if `literals.title` and `literalsDefault.title` match' , ( ) => {
282+ it ( 'p-literals: should set `containsCustomLiterals` with false if `literals.title` and `literals.loginHint` are undefined' , ( ) => {
283+ component [ '_literals' ] = { title : undefined , loginHint : undefined } ;
284+ component . selectedLanguage = poLocaleDefault ;
285+ const validLiterals = component [ '_literals' ] ;
286+
287+ spyOn ( component , < any > 'getLiterals' ) ;
288+
289+ expectPropertiesValues ( component , 'literals' , validLiterals , validLiterals ) ;
290+ expect ( component . getLiterals ) . toHaveBeenCalledWith ( poLocaleDefault , validLiterals ) ;
291+ expect ( component . containsCustomLiterals ) . toBe ( false ) ;
292+ } ) ;
293+
294+ it ( 'p-literals: should set `containsCustomLiterals` with false if `literals.title` and `literalsDefault.loginHint` match' , ( ) => {
283295 component [ '_literals' ] = {
284296 title : poPageLoginLiteralsDefault [ poLocaleDefault ] . title ,
285297 loginHint : poPageLoginLiteralsDefault [ poLocaleDefault ] . loginHint
@@ -295,7 +307,7 @@ describe('ThPageLoginBaseComponent: ', () => {
295307
296308 } ) ;
297309
298- xit ( 'p-literals: should set `constainsLiterals ` with true if `literals.loginHint` and `literalsDefault.loginHint` match' , ( ) => {
310+ xit ( 'p-literals: should set `containsCustomLiterals ` with true if `literals.loginHint` and `literalsDefault.loginHint` match' , ( ) => {
299311 component [ '_literals' ] = poPageLoginLiteralsDefault [ poLocaleDefault ] ;
300312 const validLiterals = component [ '_literals' ] ;
301313
@@ -795,6 +807,20 @@ describe('ThPageLoginBaseComponent: ', () => {
795807 expect ( component [ 'concatenateLiteral' ] ) . not . toHaveBeenCalled ( ) ;
796808 } ) ;
797809
810+ it ( `setTitleLiteral: shouldn´t set literals.title with default value if value is undefined` , ( ) => {
811+ const title = undefined ;
812+ const literals = { title, loginHint : 'Teste 1' } ;
813+
814+ component . literals = { ...literals } ;
815+
816+ spyOn ( component , < any > 'concatenateLiteral' ) ;
817+
818+ component . setTitleLiteral ( poLocaleDefault , title ) ;
819+
820+ expect ( component . literals . title ) . toEqual ( title ) ;
821+ expect ( component [ 'concatenateLiteral' ] ) . not . toHaveBeenCalled ( ) ;
822+ } ) ;
823+
798824 it ( `getLiterals: should set 'p-literals' with browser language if 'language' and 'value' parameters haven't been passed
799825 and the browser is set with an unsupported language` , ( ) => {
800826 component . literals = { } ;
0 commit comments