Skip to content

Commit f7f0bbe

Browse files
committed
fix lint
1 parent 029d377 commit f7f0bbe

1 file changed

Lines changed: 26 additions & 10 deletions

File tree

test/cypress/tests/inline-tools/link.cy.ts

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -207,19 +207,35 @@ describe('Inline Tool Link', () => {
207207
},
208208
});
209209

210-
const editor = '[data-cy=editorjs]';
210+
cy.get('[data-cy=editorjs]')
211+
.find('.ce-paragraph')
212+
.selectText('Link text');
213+
214+
cy.get('[data-cy=editorjs]')
215+
.find('[data-item-name=link]')
216+
.click();
217+
218+
cy.get('[data-cy=editorjs]')
219+
.find('.ce-inline-tool-input')
220+
.type('https://test.io/')
221+
.type('{enter}');
211222

212-
cy.get(`${editor} .ce-paragraph`).selectText('Link text');
213-
cy.get(`${editor} [data-item-name=link]`).click();
214-
cy.get(`${editor} .ce-inline-tool-input`).type('https://test.io{enter}');
223+
cy.get('[data-cy=editorjs]')
224+
.find('div.ce-block')
225+
.find('a')
226+
.selectText('Link text');
215227

216-
cy.get(`${editor} a`).selectText('Link text');
217-
cy.get(`${editor} [data-item-name=italic]`).click();
228+
cy.get('[data-cy=editorjs]')
229+
.find('[data-item-name=italic]')
230+
.click();
218231

219-
cy.window().then((win) => cy.stub(win, 'open').as('open'));
232+
cy.window().then((win) => {
233+
cy.stub(win, 'open').as('windowOpen');
234+
});
220235

221-
cy.contains(`${editor} i`, 'Link text').click({ ctrlKey: true });
236+
cy.contains('[data-cy=editorjs] div.ce-block i', 'Link text')
237+
.click({ ctrlKey: true });
222238

223-
cy.get('@open').should('have.been.calledWith', 'https://test.io/');
224-
})
239+
cy.get('@windowOpen').should('be.calledWith', 'https://test.io/');
240+
});
225241
});

0 commit comments

Comments
 (0)