|
|
@@ -14,10 +14,15 @@ const WelcomeMessage = () => {
|
|
|
|
|
|
describe('<WelcomeMessage />', function () {
|
|
|
beforeEach(function () {
|
|
|
+ window.metaAttributesCache.set('ol-splitTestVariants', {
|
|
|
+ 'import-docx': 'enabled',
|
|
|
+ })
|
|
|
+
|
|
|
Object.assign(getMeta('ol-ExposedSettings'), {
|
|
|
isOverleaf: true,
|
|
|
wikiEnabled: true,
|
|
|
templatesEnabled: true,
|
|
|
+ enablePandocConversions: true,
|
|
|
})
|
|
|
})
|
|
|
|
|
|
@@ -42,9 +47,24 @@ describe('<WelcomeMessage />', function () {
|
|
|
screen.getByText('Blank project')
|
|
|
screen.getByText('Example project')
|
|
|
screen.getByText('Upload project')
|
|
|
+ screen.getByText('Import Word document')
|
|
|
screen.getByText('Import from GitHub')
|
|
|
})
|
|
|
|
|
|
+ it('does not show the import from Word document when the feature is disabled', function () {
|
|
|
+ getMeta('ol-ExposedSettings').enablePandocConversions = false
|
|
|
+ render(<WelcomeMessage />)
|
|
|
+
|
|
|
+ const button = screen.getByRole('button', {
|
|
|
+ name: 'Create a new project',
|
|
|
+ })
|
|
|
+
|
|
|
+ fireEvent.click(button)
|
|
|
+
|
|
|
+ screen.getByText('Blank project')
|
|
|
+ expect(screen.queryByText('Import Word document')).to.not.exist
|
|
|
+ })
|
|
|
+
|
|
|
it('show the correct dropdown menu for affiliated users', function () {
|
|
|
window.metaAttributesCache.set('ol-portalTemplates', [
|
|
|
{
|