Skip to content
This repository has been archived by the owner on Jan 23, 2025. It is now read-only.

Commit

Permalink
refactor: fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pyphilia committed May 22, 2024
1 parent 28421ef commit dec7958
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion cypress/e2e/item/publish/coEditorSettings.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ const item = PackedFolderItemFactory(
{ permission: null, publicTag: { type: ItemTagType.Public } },
);

describe.only('Co-editor setting permissions', () => {
describe('Co-editor setting permissions', () => {
it('User signed out cannot edit co-editor setting', () => {
cy.setUpApi({
items: [item],
Expand Down
2 changes: 1 addition & 1 deletion cypress/support/commands/navigation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ Cypress.Commands.add('goToHome', () => {
});

Cypress.Commands.add('goToItemWithNavigation', (id) => {
cy.get(`[href="${buildItemPath(id)}"]`).click();
cy.get(`[href^="${buildItemPath(id)}"]`).click();
});
10 changes: 8 additions & 2 deletions src/components/common/ShareButton.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Link } from 'react-router-dom';
import { Link, useSearchParams } from 'react-router-dom';

import { ShareButton as GraaspShareButton } from '@graasp/ui';

Expand All @@ -16,10 +16,16 @@ type Props = {
};

const ShareButton = ({ itemId }: Props): JSX.Element => {
const [searchParams] = useSearchParams();
const { t: translateBuilder } = useBuilderTranslation();

return (
<Link to={buildItemSharePath(itemId)}>
<Link
to={{
pathname: buildItemSharePath(itemId),
search: searchParams.toString(),
}}
>
<GraaspShareButton
tooltip={translateBuilder(BUILDER.SHARE_ITEM_BUTTON)}
ariaLabel={translateBuilder(BUILDER.SHARE_ITEM_BUTTON)}
Expand Down
2 changes: 1 addition & 1 deletion src/components/layout/Navigation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ const Navigator = (): JSX.Element | null => {

return (
<>
<Link to={HOME_PATH}>
<Link to={{ pathname: HOME_PATH, search: searchParams.toString() }}>
<IconButton id={NAVIGATION_HOME_ID}>
<Home />
</IconButton>
Expand Down

0 comments on commit dec7958

Please sign in to comment.