Skip to content

Commit

Permalink
Improve e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
filippomc committed Oct 12, 2022
1 parent c89be24 commit 6635859
Show file tree
Hide file tree
Showing 6 changed files with 230 additions and 447 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,14 @@ export const OSBSplitButton = (props: OSBSplitButtonProps) => {
ref={anchorRef}
aria-label="split button"
>
<Button onClick={handleItemClick}>Open with {selected.name}</Button>
<Button className={`open-workspace`} onClick={handleItemClick}>Open with {selected.name}</Button>
<Button
color="primary"
aria-controls={open ? "split-button-menu" : undefined}
aria-expanded={open ? "true" : undefined}
aria-label="select merge strategy"
aria-haspopup="menu"
className="split-button-control"
onClick={handleToggle}
>
<ArrowDropDownIcon />
Expand Down
4 changes: 2 additions & 2 deletions applications/osb-portal/src/components/header/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export const Header = (props: any) => {

const headerText =
user === null ? (
<Button onClick={handleUserLogin} className={classes.button}>
<Button onClick={handleUserLogin} className={`sign-in ${classes.button}`}>
Sign in
</Button>
) : (
Expand Down Expand Up @@ -132,7 +132,7 @@ export const Header = (props: any) => {
aria-haspopup="true"
onClick={handleMenuToggle}
startIcon={<PersonIcon fontSize="large" />}
className={classes.button}
className={`${classes.button} user-menu-btn`}
>
{user.username}
</Button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,52 +124,53 @@ export default (props: WorkspaceActionsMenuProps) => {

return (
<>
<IconButton size="small" onClick={handleClick}>
<IconButton className="btn-workspace-actions" size="small" onClick={handleClick}>
<Icons.Dots style={{ fontSize: "1rem" }} />
</IconButton>
<Menu
id="simple-menu"
id="workspace-actions-menu"
anchorEl={anchorEl}
keepMounted={true}
open={Boolean(anchorEl)}
onClose={handleCloseMenu}
>
{canEdit && <MenuItem onClick={handleEditWorkspace}>Edit</MenuItem>}
{canEdit && <MenuItem onClick={handleDeleteWorkspace}>Delete</MenuItem>}
{canEdit && <MenuItem className="edit-workspace" onClick={handleEditWorkspace}>Edit</MenuItem>}
{canEdit && <MenuItem className="delete-workspace" onClick={handleDeleteWorkspace}>Delete</MenuItem>}
{canEdit && !props.workspace.publicable && (
<MenuItem onClick={handlePublicWorkspace}>Make public</MenuItem>
<MenuItem className="make-public-workspace" onClick={handlePublicWorkspace}>Make public</MenuItem>
)}
{canEdit && props.workspace.publicable && (
<MenuItem onClick={handlePrivateWorkspace}>Make private</MenuItem>
<MenuItem className="make-private-workspace" onClick={handlePrivateWorkspace}>Make private</MenuItem>
)}
{props.user &&
props.user.isAdmin &&
props.workspace.publicable &&
!props.workspace.featured && (
<MenuItem onClick={handleFeaturedWorkspace}>
<MenuItem className="add-featured-workspace" onClick={handleFeaturedWorkspace}>
Add to featured
</MenuItem>
)}
{props.user && props.user.isAdmin && props.workspace.featured && (
<MenuItem onClick={handleFeaturedWorkspace}>
<MenuItem className="remove-featured-workspace" onClick={handleFeaturedWorkspace}>
Remove from featured
</MenuItem>
)}
{!props.isWorkspaceOpen && (
<MenuItem onClick={handleOpenWorkspace}>Open workspace</MenuItem>
<MenuItem className="open-workspace" onClick={handleOpenWorkspace}>Open workspace</MenuItem>
)}
{props.user && (
<MenuItem onClick={handleCloneWorkspace}>Clone workspace</MenuItem>
)}
<NestedMenuItem label="Open with..." parentMenuOpen={true}>
{Object.keys(OSBApplications).map((item) => (
<NestedMenuItem className="open-with" label="Open with..." parentMenuOpen={true}>
{Object.keys(OSBApplications).map((appCode) => (
<MenuItem
key={item}
key={appCode}
className={appCode}
onClick={(e) => {
handleOpenWorkspaceWithApp(item);
handleOpenWorkspaceWithApp(appCode);
}}
>
{OSBApplications[item].name}
{OSBApplications[appCode].name}
</MenuItem>
))}
</NestedMenuItem>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ export const WorkspaceCard = (props: Props) => {

return (
<>
<Card className={classes.card} elevation={0}>
<Card className={`${classes.card} workspace-card`} elevation={0}>
{!props.hideMenu && (
<CardActions className={classes.actions}>
<WorkspaceActionsMenu
Expand Down Expand Up @@ -159,12 +159,12 @@ export const WorkspaceCard = (props: Props) => {
</Link>
</Box>

<CardContent>
<CardContent className="workspace-content">
<Tooltip title={workspace.name}>
<Link
href={`/workspace/${workspace.id}`}
color="inherit"
className={classes.link}
className={`${classes.link} workspace-page-link`}
>
<Typography
component="h2"
Expand Down
Loading

0 comments on commit 6635859

Please sign in to comment.