diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index c79fa0eec..813e3fe41 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -9,6 +9,7 @@ - fixed #12089: Cannot refund item in transaction if the sku no longer exists. - rfe #12085: Export Related Story Topics - fixed #12076: Paginator shows no results with cached page index + - fixed #12087: Extend WebGUI tests to check template attachments 7.10.12 - fixed #12072: Product, related and accessory assets diff --git a/docs/upgrades/packages-7.10.13/default_search2.wgpkg b/docs/upgrades/packages-7.10.13/default_search2.wgpkg new file mode 100644 index 000000000..faee2be09 Binary files /dev/null and b/docs/upgrades/packages-7.10.13/default_search2.wgpkg differ diff --git a/t/badExtrasMacros.t b/t/badExtrasMacros.t index f6af6186c..c7434cc4b 100644 --- a/t/badExtrasMacros.t +++ b/t/badExtrasMacros.t @@ -52,10 +52,13 @@ my @templateLabels; while (my $templateAsset = $getATemplate->()) { my $template = $templateAsset->get('template'); my $header = $templateAsset->get('extraHeadTags'); - my $match = ($template =~ $macro); + my $match = ($template =~ $macro); if ($header) { $match ||= ($header =~ $macro); } + foreach my $attachment (@{ $templateAsset->getAttachments }) { + $match ||= ($attachment->{url} =~ $macro); + } ok(!$match, sprintf "%s: %s (%s) has no bad extras macros", $templateAsset->getTitle, $templateAsset->getId, $templateAsset->getUrl); } diff --git a/t/badGatewayMacros.t b/t/badGatewayMacros.t index 4fbbbeaf6..2d74ec74c 100644 --- a/t/badGatewayMacros.t +++ b/t/badGatewayMacros.t @@ -55,6 +55,9 @@ while (my $templateAsset = $getATemplate->()) { if ($header) { $match ||= ($header =~ $macro); } + foreach my $attachment (@{ $templateAsset->getAttachments }) { + $match ||= ($attachment->{url} =~ $macro); + } ok(!$match, sprintf "%s: %s (%s) has no bad gateway macros", $templateAsset->getTitle, $templateAsset->getId, $templateAsset->getUrl); } diff --git a/t/hardcodedExtras.t b/t/hardcodedExtras.t index a4c6788e2..ca30a269d 100644 --- a/t/hardcodedExtras.t +++ b/t/hardcodedExtras.t @@ -45,6 +45,16 @@ TEMPLATE: while (my $templateAsset = $getATemplate->()) { type => 'Template', } } + foreach my $attachment (@{ $templateAsset->getAttachments }) { + if ($attachment->{url} =~ m!$hardcodedExtras! ) { + push @hardcodedExtras, { + url => $templateAsset->getUrl, + id => $templateAsset->getId, + title => $templateAsset->getTitle, + type => 'Template', + } + } + } } my $getASnippet = WebGUI::Asset::Snippet->getIsa($session); diff --git a/t/rawHrefUrls.t b/t/rawHrefUrls.t index 8d9011818..ec0dc6537 100644 --- a/t/rawHrefUrls.t +++ b/t/rawHrefUrls.t @@ -38,7 +38,7 @@ my $macro = qr{ $numTests = $session->db->quickScalar('select count(distinct(assetId)) from template'); -plan tests => 2*$numTests; +plan tests => 3*$numTests; my $validLinks = 0; @@ -91,4 +91,9 @@ TEMPLATE: while (my $templateAsset = $getATemplate->()) { $parser->parse($template); ok($validLinks, sprintf "%s: %s (%s) has no rooted link urls in the template", $templateAsset->getTitle, $templateAsset->getId, $templateAsset->getUrl); } + my $bad_attachments = 0; + foreach my $attachment (@{ $templateAsset->getAttachments }) { + ++$bad_attachments if $attachment->{url} !~ $nonRootLink; + } + ok $bad_attachments == 0, sprintf "%s: %s (%s) has no rooted link urls in the template attachments", $templateAsset->getTitle, $templateAsset->getId, $templateAsset->getUrl; }