) {
return (
<NavBarNotif className="alert alert-danger">
- <span>{currentTask.errorMessage}</span>
- {this.context.canAdmin && (
- <Link className="little-spacer-left" to="/admin/extension/license/app">
+ <span className="little-spacer-right">{currentTask.errorMessage}</span>
+ {this.context.canAdmin ? (
+ <Link to="/admin/extension/license/app">
{translate('license.component_navigation.button', currentTask.errorType)}.
</Link>
+ ) : (
+ translate('please_contact_administrator')
)}
</NavBarNotif>
);
expect(
getWrapper({ currentTask: { status: 'FAILED', errorType: 'LICENSING', errorMessage: 'Foo' } })
).toMatchSnapshot();
+ expect(
+ getWrapper(
+ { currentTask: { status: 'FAILED', errorType: 'LICENSING', errorMessage: 'Foo' } },
+ { canAdmin: false }
+ )
+ ).toMatchSnapshot();
});
-function getWrapper(props = {}) {
+function getWrapper(props = {}, context = {}) {
return shallow(
<ComponentNavBgTaskNotif
component={component}
currentTask={{ status: 'FAILED' } as Task}
{...props}
/>,
- { context: { canAdmin: true } }
+ { context: { canAdmin: true, ...context } }
);
}
<NavBarNotif
className="alert alert-danger"
>
- <span>
+ <span
+ className="little-spacer-right"
+ >
Foo
</span>
<Link
- className="little-spacer-left"
onlyActiveOnIndex={false}
style={Object {}}
to="/admin/extension/license/app"
</NavBarNotif>
`;
+exports[`renders background task license info correctly 2`] = `
+<NavBarNotif
+ className="alert alert-danger"
+>
+ <span
+ className="little-spacer-right"
+ >
+ Foo
+ </span>
+ please_contact_administrator
+</NavBarNotif>
+`;
+
exports[`renders background task pending info correctly 1`] = `
<NavBarNotif
className="alert alert-info"
no_results_search.2=Try to change filters to get some results.
no_results_search.favorites.2=Would you like to search among {url} projects?
page_extension_failed=Page extension failed.
+please_contact_administrator=Please contact the instance administrator.
set_as_default=Set as Default
unset_as_default=Unset as Default
show_more=Show More