Skip to content

Commit

Permalink
fix: test:cy imports
Browse files Browse the repository at this point in the history
  • Loading branch information
jmfrancois committed Oct 12, 2023
1 parent f207ed3 commit e1dd6da
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable testing-library/prefer-screen-queries */
/* eslint-disable testing-library/await-async-query */
/* eslint-disable no-console */
import Dropdown from './';
import { Dropdown } from './';

import { ButtonTertiary } from '../../components/Button';
import { IconsProvider } from '../../components/IconsProvider';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable cypress/unsafe-to-chain-command */
/* eslint-disable testing-library/await-async-query */
/* eslint-disable testing-library/prefer-screen-queries */
import InlineEditing from './';
import { InlineEditing } from './';

context('<InlineEditing />', () => {
it('should go to edit mode when clicking on the button', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import InlineEditingMulti from './InlineEditing.textarea';
import { InlineEditingTextarea } from './InlineEditing.textarea';

context('<InlineEditing.Textarea />', () => {
const defaultProps = {
Expand All @@ -7,14 +7,14 @@ context('<InlineEditing.Textarea />', () => {
};

it('should render with filled value', () => {
cy.mount(<InlineEditingMulti {...defaultProps} defaultValue="Some text" />);
cy.mount(<InlineEditingTextarea {...defaultProps} defaultValue="Some text" />);

cy.get('[data-testid="inlineediting.button.edit"]').should('exist');
cy.get('p').should('have.text', 'Some text');
});

it('should allow inline editing', () => {
cy.mount(<InlineEditingMulti {...defaultProps} />);
cy.mount(<InlineEditingTextarea {...defaultProps} />);

// Switch to edit mode
cy.get('[data-testid="inlineediting.button.edit"]').click();
Expand All @@ -30,7 +30,7 @@ context('<InlineEditing.Textarea />', () => {
});

it('should allow to have some constraints', () => {
cy.mount(<InlineEditingMulti {...defaultProps} required={true} maxLength={10} />);
cy.mount(<InlineEditingTextarea {...defaultProps} required={true} maxLength={10} />);

cy.get('[data-testid="inlineediting.button.edit"]').click();
cy.get('[data-testid="inlineediting.textarea"]').should('have.attr', 'required');
Expand Down
3 changes: 2 additions & 1 deletion packages/design-system/src/components/Link/Link.cy.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/* eslint-disable testing-library/await-async-query */
/* eslint-disable testing-library/prefer-screen-queries */
import Link from './';
import { Link } from './';

context('<Link />', () => {
it('should render', () => {
cy.mount(
Expand Down
2 changes: 1 addition & 1 deletion packages/design-system/src/components/Modal/Modal.cy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
/* eslint-disable testing-library/prefer-screen-queries */
import { useState } from 'react';
import { ButtonPrimary } from '../Button';
import Modal, { ModalPropsType } from './Modal';
import { Modal, ModalPropsType } from './Modal';

function ModalStory(props: Partial<ModalPropsType>) {
const [modalOpen, setModalOpen] = useState(false);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable testing-library/prefer-screen-queries */
/* eslint-disable testing-library/await-async-query */
import Stepper from '.';
import { Stepper } from '.';

context('<Stepper />', () => {
it('should render first step as current step', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable testing-library/prefer-screen-queries */
/* eslint-disable testing-library/await-async-query */
import Tooltip from './Tooltip';
import { Tooltip } from './Tooltip';

context('<Tooltip />', () => {
describe('default', () => {
Expand Down

0 comments on commit e1dd6da

Please sign in to comment.