import { expect , fixture } from "@open-wc/testing" ; import { Text } from "../index" ; describe ( "Text" , ( ) => { describe ( "textAlign" , ( ) => { it ( "shoul be left when not set textAlign in constructor" , async ( ) => { const container = new Text ( ) ; const el = await fixture ( container ) ; const inputEl = el . querySelector ( ".kuc-text__group__input-form__input-outer__input" ) as HTMLInputElement ; expect ( inputEl . getAttribute ( "textalign" ) ) . to . equal ( "left" ) ; expect ( window . getComputedStyle ( inputEl ) . textAlign ) . to . equal ( "left" ) ; } ) ; it ( "should be right when set right in constructor" , async ( ) => { const container = new Text ( { textAlign : "right" } ) ; const el = await fixture ( container ) ; const inputEl = el . querySelector ( ".kuc-text__group__input-form__input-outer__input" ) as HTMLInputElement ; expect ( inputEl . getAttribute ( "textalign" ) ) . to . equal ( "right" ) ; expect ( window . getComputedStyle ( inputEl ) . textAlign ) . to . equal ( "right" ) ; } ) ; it ( "should be right when updating to right" , async ( ) => { const container = new Text ( ) ; container . textAlign = "right" ; const el = await fixture ( container ) ; const inputEl = el . querySelector ( ".kuc-text__group__input-form__input-outer__input" ) as HTMLInputElement ; expect ( inputEl . getAttribute ( "textalign" ) ) . to . equal ( "right" ) ; expect ( window . getComputedStyle ( inputEl ) . textAlign ) . to . equal ( "right" ) ; } ) ; it ( "should be right when updating textAlign from left to right" , async ( ) => { const container = new Text ( { textAlign : "left" } ) ; container . textAlign = "right" ; const el = await fixture ( container ) ; const inputEl = el . querySelector ( ".kuc-text__group__input-form__input-outer__input" ) as HTMLInputElement ; expect ( inputEl . getAttribute ( "textalign" ) ) . to . equal ( "right" ) ; expect ( window . getComputedStyle ( inputEl ) . textAlign ) . to . equal ( "right" ) ; } ) ; } ) ; } ) ;