@@ -169,7 +169,8 @@ public function testProductMetaDescriptionShouldBeRenderedAsIs()
169
169
}
170
170
171
171
/**
172
- * If the product meta description is empty, it should be substituted with the product name
172
+ * If the product meta description is empty, it should not be substituted with any other data and should not be
173
+ * rendered on the product HTML sources
173
174
*
174
175
* @return void
175
176
* @throws LocalizedException
@@ -182,7 +183,7 @@ public function testProductMetaDescriptionShouldBeRenderedAsIs()
182
183
public function testEmptyProductMetaDescriptionShouldNotBeSubstitutedAndRendered ()
183
184
{
184
185
$ product = $ this ->fixtures ->get ('p1 ' );
185
- $ metaDescription = sprintf ( '<meta name="description" content="%s"/> ' , $ product -> getName ()) ;
186
+ $ metaDescription = '<meta name="description" content=" ' ;
186
187
187
188
$ this ->objectManager ->get (\Magento \Framework \App \RequestInterface::class)->setParam ('id ' , $ product ->getId ());
188
189
$ this ->_helper ->prepareAndRender ($ this ->page , $ product ->getId (), $ this ->_controller );
@@ -193,10 +194,10 @@ public function testEmptyProductMetaDescriptionShouldNotBeSubstitutedAndRendered
193
194
$ this ->page ->renderResult ($ response );
194
195
195
196
$ this ->assertNotEmpty ($ response ->getBody ());
196
- $ this ->assertStringContainsStringIgnoringCase (
197
+ $ this ->assertStringNotContainsStringIgnoringCase (
197
198
$ metaDescription ,
198
199
$ response ->getBody (),
199
- 'Empty meta description should be substituted with the product name '
200
+ 'Empty meta description should not be substituted or rendered '
200
201
);
201
202
}
202
203
0 commit comments