Merge "Don't force the "view" flavor when using stashing!"

This commit is contained in:
jenkins-bot 2023-05-01 13:46:25 +00:00 committed by Gerrit Code Review
commit 0a28512624
2 changed files with 8 additions and 1 deletions

View file

@ -85,7 +85,9 @@ class DirectParsoidClient implements ParsoidClient {
$helper->init( $page, [], $user, $revision );
$helper->setStashingEnabled( $stash );
$helper->setFlavor( $flavor );
if ( !$stash ) {
$helper->setFlavor( $flavor );
}
if ( $revision ) {
$helper->setRevision( $revision );

View file

@ -195,6 +195,11 @@ class DirectParsoidClientTest extends MediaWikiIntegrationTestCase {
$oldHtml = $pageHtmlResponse['body'];
$updatedHtml = str_replace( '</body>', '<p>More Text</p></body>', $oldHtml );
// Make sure the etag is for "stash" flavor HTML.
// The ETag should be transparent, but this is the easiest way to check that we are getting
// the correct flavor of HTML.
$this->assertMatchesRegularExpression( '@/stash\b@', $eTag );
// Now make a new client object, so we can mock the ParsoidOutputAccess.
$parsoidOutputAccess = $this->createNoOpMock( ParsoidOutputAccess::class );
$services = $this->getServiceContainer();