Add unit test for removing displa:none from emails
This commit is contained in:
parent
6612d1f859
commit
af810af57a
|
@ -50,4 +50,17 @@ class WC_Tests_WC_Emails extends WC_Unit_Test_Case {
|
|||
$this->assertEquals( $expected, $result );
|
||||
}
|
||||
|
||||
/**
|
||||
* Test that we remove elemets with style display none from html mails.
|
||||
*/
|
||||
public function test_remove_display_none_elements() {
|
||||
$email = new WC_Email();
|
||||
$email->email_type = 'html';
|
||||
$str_present = 'Should be present!';
|
||||
$str_removed = 'Should be removed!';
|
||||
$result = $email->style_inline( "<div><div class='text'>$str_present</div><div style='display: none'>$str_removed</div> </div>" );
|
||||
$this->assertTrue( false !== strpos( $result, $str_present ) );
|
||||
$this->assertTrue( false === strpos( $result, $str_removed ) );
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue