Skip to content

Commit

Permalink
fix: e2e on dashboard and projects pages
Browse files Browse the repository at this point in the history
  • Loading branch information
IgorGoryany committed Aug 12, 2024
1 parent a703395 commit 4bca886
Show file tree
Hide file tree
Showing 7 changed files with 134 additions and 53 deletions.
7 changes: 1 addition & 6 deletions cypress/e2e/dashboard.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,16 +102,11 @@ describe('User dashboard', () => {
});

it("user can create goal from projects's list", () => {
const translations = getTranslation({
InlineCreateGoalControl: ['Create goal'],
});
cy.get(projectListItem.query).should('not.exist');

cy.get(filtersPanelResetButton.query).should('exist').click().should('not.exist');

cy.get(projectListItem.query)
.find(createGoalInlineControl.query)
.and('include.text', translations.InlineCreateGoalControl['Create goal']());
cy.get(projectListItem.query).find(createGoalInlineControl.query).and('not.include.text');
});

after(() => {
Expand Down
120 changes: 120 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

This file was deleted.

This file was deleted.

This file was deleted.

22 changes: 0 additions & 22 deletions src/components/InlineCreateGoalControl/InlineCreateGoalControl.tsx

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { useProjectResource } from '../../hooks/useProjectResource';
import { dispatchModalEvent, ModalEvent } from '../../utils/dispatchModal';
import { StarButton } from '../StarButton/StarButton';
import { WatchButton } from '../WatchButton/WatchButton';
import { createGoalInlineControl } from '../../utils/domObjects';

import { tr } from './ProjectSubscriptionButtons.i18n';

Expand Down Expand Up @@ -43,9 +44,19 @@ export const ProjectSubscriptionButtons: FC<ProjectSubscriptionButtonsProps> = (
{nullable(
view === 'icons',
() => (
<Button view="clear" iconLeft={<IconAddOutline size="s" />} onClick={onAddClick} />
<Button
{...createGoalInlineControl.attr}
view="clear"
iconLeft={<IconAddOutline size="s" />}
onClick={onAddClick}
/>
),
<Button text={tr('Create goal')} iconLeft={<IconAddOutline size="s" />} onClick={onAddClick} />,
<Button
{...createGoalInlineControl.attr}
text={tr('Create goal')}
iconLeft={<IconAddOutline size="s" />}
onClick={onAddClick}
/>,
)}
</>
);
Expand Down

0 comments on commit 4bca886

Please sign in to comment.