Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
data-track-component="Navigation-Support-links"
data-track-event="click"
data-track-label="support_textlink"
onClick={props.downshiftProps.toggleMenu}
>
<menuitem>
</menuitem>
<menuitem>
<a data-test="logout-button" href="{`/logout?reason=${LOGOUT_REASONS.USER}`}" for="">
<menuitem tabindex="0">
</menuitem>
</a>
);
};
UserSettingsMenuBody.displayName = 'UserSettingsMenuBody';</menuitem>
render={({ location }) => (
)}
/>
it('should log out with reason "user"', () => {
cy.login({ redirectToUri: URL_STATE_MACHINES });
cy.findByLabelText('open menu').click();
cy.findByText('Logout').click();
const queryParams = encode({
reason: LOGOUT_REASONS.USER,
});
cy.url().should('include', `/logout?${queryParams}`);
cy.findByText('This is the logout page for local development.').should(
'exist'
);
});
describe('when going to an unknown route', () => {
if (!error) return null;
switch (error) {
case LOGOUT_REASONS.NO_PROJECTS: {
const link = (
<a href="{`${this.props.adminCenterUrl}/login`}">
</a>
);
return (
);
}
case LOGOUT_REASONS.USER:
return (
);
case LOGOUT_REASONS.UNAUTHORIZED:
return (
);
case LOGOUT_REASONS.INVALID:
return (
id: 'go/account-profile',
text: intl.formatMessage(messages.openMyProfile),
keywords: ['Go to user account', 'Go to profile', 'Open profile'],
action: { type: 'go', to: `/account/profile` },
},
{
id: 'go/privacy-policy',
text: intl.formatMessage(messages.showPrivacyPolicy),
keywords: ['Open Privacy Policy'],
action: { type: 'go', to: 'https://commercetools.com/privacy#suppliers' },
},
{
id: 'go/logout',
text: intl.formatMessage(messages.logout),
keywords: ['Sign out'],
action: { type: 'go', to: `/logout?reason=${LOGOUT_REASONS.USER}` },
},
{
id: 'go/manage-projects',
text: intl.formatMessage(messages.openManageProjects),
keywords: [
'Go to manage projects',
'Go to projects',
'Open projects list',
],
action: { type: 'go', to: `/account/projects` },
},
{
id: 'go/manage-organizations',
text: intl.formatMessage(messages.openManageOrganizations),
keywords: [
'Go to manage organizations',