From 1bad59b01dd27dda8e6ae57bd72a0e0b4d40fbfe Mon Sep 17 00:00:00 2001 From: Charly Zauleck Date: Tue, 21 Jan 2025 13:50:37 +0000 Subject: [PATCH] Issue #4027: improved tests --- .../test/Layout/RichTextDocumentComplete.t | 31 +++++-------------- 1 file changed, 7 insertions(+), 24 deletions(-) diff --git a/scripts/test/Layout/RichTextDocumentComplete.t b/scripts/test/Layout/RichTextDocumentComplete.t index 08f951ae2..3b064e463 100644 --- a/scripts/test/Layout/RichTextDocumentComplete.t +++ b/scripts/test/Layout/RichTextDocumentComplete.t @@ -23,7 +23,6 @@ use utf8; # CPAN modules use Test2::V0; -use CSS::Minifier::XS (); # OTOBO modules use Kernel::System::UnitTest::RegisterOM; # Set up $Kernel::OM @@ -39,31 +38,17 @@ my $LayoutObject = $Kernel::OM->Get('Kernel::Output::HTML::Layout'); ### Setting up # Minimize amount of added CSS for testing -my $TestCustomCSS = ''; -my $TestCKEditorContentCSS = ''; - -my $TestCKEditorContentCSSPath = ''; -my $StandardContentCSSPath = $ConfigObject->Get('Home') . '/var/httpd/htdocs/skins/Agent/default/css/RichTextArticleContent.css'; - $Helper->ConfigSettingChange( Key => 'Frontend::RichText::DefaultCSS', - Value => $TestCustomCSS, + Value => '', Valid => 1, ); $Helper->ConfigSettingChange( Key => 'Frontend::RichTextArticleStyles', - Value => $TestCKEditorContentCSSPath, + Value => '', Valid => 1, ); -my $StandardContentCSS = ${ - $MainObject->FileRead( - Location => $StandardContentCSSPath, - ) -}; - -our $MinifiedCSS = CSS::Minifier::XS::minify($StandardContentCSS); - my @Tests = ( { Line => __LINE__, @@ -102,17 +87,15 @@ my @Tests = ( for my $Test (@Tests) { my $Result = $Test->{Result}; - my $HTMLString = $Test->{String} - + + my $HTMLString = $LayoutObject->RichTextDocumentComplete( + String => $Test->{String}, + ); + #Remove OTOBO Copyright comment for easier testing $Result =~ s/\/\*[\s\S]*?\*\///; $HTMLString =~ s/\/\*[\s\S]*?\*\///; - $LayoutObject->RichTextDocumentComplete( - String => $HTMLString, - ); - - TextEqOrDiff( "$HTMLString\n", "$Result\n",