| Group memberships |
You are not part of any group |
diff --git a/web/packages/web-runtime/tests/unit/pages/account.spec.ts b/web/packages/web-runtime/tests/unit/pages/account.spec.ts
index 426fcf4fc80..c7c018df27a 100644
--- a/web/packages/web-runtime/tests/unit/pages/account.spec.ts
+++ b/web/packages/web-runtime/tests/unit/pages/account.spec.ts
@@ -14,7 +14,8 @@ import {
useExtensionRegistry,
useMessages,
useSharesStore,
- useResourcesStore
+ useResourcesStore,
+ WebThemeType
} from '@ownclouders/web-pkg'
import { LanguageOption, SettingsBundle, SettingsValue } from '../../../src/helpers/settings'
import { User } from '@ownclouders/web-client/graph/generated'
@@ -34,6 +35,8 @@ const selectors = {
editUrlButton: '[data-testid="account-page-edit-url-btn"]',
editPasswordButton: '[data-testid="account-page-edit-password-btn"]',
logoutButton: '[data-testid="account-page-logout-url-btn"]',
+ softwareLicenseLink: '[data-testid="account-page-software-license-link"]',
+ helpPageLink: '[data-testid="account-page-help-page-link"]',
accountPageInfo: '.account-page-info',
groupNames: '[data-testid="group-names"]',
groupNamesEmpty: '[data-testid="group-names-empty"]',
@@ -76,6 +79,44 @@ describe('account page', () => {
expect(editUrlButton.exists()).toBeFalsy()
})
})
+ describe('software license link', () => {
+ it('should be displayed if defined via config', async () => {
+ const { wrapper } = getWrapper({
+ softwareLicenseUrl: 'https://example.com/license'
+ })
+ await blockLoadingState(wrapper)
+
+ const link = wrapper.find(selectors.softwareLicenseLink)
+ expect(link.exists()).toBeTruthy()
+ expect(link.attributes('href')).toEqual('https://example.com/license')
+ })
+ it('should not be displayed if not defined via config', async () => {
+ const { wrapper } = getWrapper()
+ await blockLoadingState(wrapper)
+
+ const link = wrapper.find(selectors.softwareLicenseLink)
+ expect(link.exists()).toBeFalsy()
+ })
+ })
+ describe('help page link', () => {
+ it('should be displayed if defined via config', async () => {
+ const { wrapper } = getWrapper({
+ helpPageUrl: 'https://example.com/help'
+ })
+ await blockLoadingState(wrapper)
+
+ const link = wrapper.find(selectors.helpPageLink)
+ expect(link.exists()).toBeTruthy()
+ expect(link.attributes('href')).toEqual('https://example.com/help')
+ })
+ it('should not be displayed if not defined via config', async () => {
+ const { wrapper } = getWrapper()
+ await blockLoadingState(wrapper)
+
+ const link = wrapper.find(selectors.helpPageLink)
+ expect(link.exists()).toBeFalsy()
+ })
+ })
})
describe('account information section', () => {
@@ -423,6 +464,8 @@ function getWrapper({
user = mock({ memberOf: [] }),
capabilities = {},
accountEditLink = undefined,
+ softwareLicenseUrl = undefined,
+ helpPageUrl = undefined,
spaces = [],
isPublicLinkContext = false,
isUserContext = true,
@@ -432,6 +475,8 @@ function getWrapper({
user?: User
capabilities?: Partial
accountEditLink?: OptionsConfig['accountEditLink']
+ softwareLicenseUrl?: string
+ helpPageUrl?: string
spaces?: SpaceResource[]
isPublicLinkContext?: boolean
isUserContext?: boolean
@@ -452,6 +497,16 @@ function getWrapper({
logoutUrl: 'https://account-manager/logout',
...(accountEditLink && { accountEditLink })
}
+ },
+ themeState: {
+ currentTheme: mock({
+ common: {
+ urls: {
+ softwareLicense: softwareLicenseUrl,
+ helpPage: helpPageUrl
+ }
+ }
+ })
}
}
})