'access administration pages',
'access content',
'create basic_page content',
'create type_one media',
'create type_four media',
'view media',
]);
$this->
drupalLogin($user);
// Visit a node create page and open the media library.
$this->
drupalGet('node/add/basic_page'
);
$this->
openMediaLibraryForField('field_twin_media'
);
// Assert the upload form is not visible for default tab type_three without
// the proper permissions.
$assert_session->
elementNotExists('css', '.js-media-library-add-form'
);
// Assert the upload form is not visible for the non-file based media type
// type_one.
$this->
switchToMediaType('One'
);
$assert_session->
elementNotExists('css', '.js-media-library-add-form'
);
// Assert the upload form is visible for type_four.