Update url-prompt.spec.js

pull/465/head
Jonathan 2 years ago committed by GitHub
parent d544259fbb
commit 0d3bac24f7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -23,7 +23,7 @@ describe('URL prompts', () => {
cy.window().then(($win) => {
const stub = cy.stub($win, 'prompt');
cy.get('button.image').click().then(() => {
cy.get('button.mde-image').click().then(() => {
expect(stub).to.be.calledWith('URL of the image:', 'https://');
});
});
@ -42,7 +42,7 @@ describe('URL prompts', () => {
cy.previewOn();
cy.get('.EasyMDEContainer .editor-preview').should('contain.html', '<p><a href="https://example.com" target="_blank">Link to a website!</a></p>');
cy.get('.EasyMDEContainer .mde-editor-preview').should('contain.html', '<p><a href="https://example.com" target="_blank">Link to a website!</a></p>');
});
it('can use the prompt multiple times', () => {
@ -76,7 +76,7 @@ describe('URL prompts', () => {
cy.previewOn();
cy.get('.EasyMDEContainer .editor-preview').should(
cy.get('.EasyMDEContainer .mde-editor-preview').should(
'contain.html',
'<p><a href="https://example.com" target="_blank">Link to a website!</a><br><a href="https://example.eu" target="_blank">Link to a second website!</a></p>',
);
@ -95,7 +95,7 @@ describe('URL prompts', () => {
cy.previewOn();
cy.get('.EasyMDEContainer .editor-preview').should('contain.html', '<p><a href="https://example.com?some=param&amp;moo=cow" target="_blank">Link to a website!</a></p>');
cy.get('.EasyMDEContainer .mde-editor-preview').should('contain.html', '<p><a href="https://example.com?some=param&amp;moo=cow" target="_blank">Link to a website!</a></p>');
});
it('must be able to deal with brackets in links', () => {
@ -111,7 +111,7 @@ describe('URL prompts', () => {
cy.previewOn();
cy.get('.EasyMDEContainer .editor-preview').should('contain.html', '<p><a href="https://example.com?some=%5B%5Dparam" target="_blank">Link to a website!</a></p>');
cy.get('.EasyMDEContainer .mde-editor-preview').should('contain.html', '<p><a href="https://example.com?some=%5B%5Dparam" target="_blank">Link to a website!</a></p>');
});
it('must be able to deal with parentheses in links', () => {
@ -127,7 +127,7 @@ describe('URL prompts', () => {
cy.previewOn();
cy.get('.EasyMDEContainer .editor-preview').should('contain.html', '<p><a href="https://example.com?some=(param)" target="_blank">Link to a website!</a></p>');
cy.get('.EasyMDEContainer .mde-editor-preview').should('contain.html', '<p><a href="https://example.com?some=(param)" target="_blank">Link to a website!</a></p>');
});
it('must be able to deal with parentheses in links (multiple)', () => {
@ -143,7 +143,7 @@ describe('URL prompts', () => {
cy.previewOn();
cy.get('.EasyMDEContainer .editor-preview').should('contain.html', '<p><a href="https://example.com?some=(param1,param2)&amp;more=(param3,param4)&amp;end=true" target="_blank">Link to a website!</a></p>');
cy.get('.EasyMDEContainer .mde-editor-preview').should('contain.html', '<p><a href="https://example.com?some=(param1,param2)&amp;more=(param3,param4)&amp;end=true" target="_blank">Link to a website!</a></p>');
});
it('must be able to deal with unbalanced parentheses in links (opening)', () => {
@ -159,7 +159,7 @@ describe('URL prompts', () => {
cy.previewOn();
cy.get('.EasyMDEContainer .editor-preview').should('contain.html', '<p><a href="https://example.com?some=(param" target="_blank">Link to a website!</a></p>');
cy.get('.EasyMDEContainer .mde-editor-preview').should('contain.html', '<p><a href="https://example.com?some=(param" target="_blank">Link to a website!</a></p>');
});
it('must be able to deal with unbalanced parentheses in links (closing)', () => {
@ -175,7 +175,7 @@ describe('URL prompts', () => {
cy.previewOn();
cy.get('.EasyMDEContainer .editor-preview').should('contain.html', '<p><a href="https://example.com?some=)param" target="_blank">Link to a website!</a></p>');
cy.get('.EasyMDEContainer .mde-editor-preview').should('contain.html', '<p><a href="https://example.com?some=)param" target="_blank">Link to a website!</a></p>');
});
it('must be able to deal with inequality symbols in links', () => {
@ -191,7 +191,7 @@ describe('URL prompts', () => {
cy.previewOn();
cy.get('.EasyMDEContainer .editor-preview').should('contain.html', '<p><a href="https://example.com?some=%3Cparam" target="_blank">Link to a website!</a></p>');
cy.get('.EasyMDEContainer .mde-editor-preview').should('contain.html', '<p><a href="https://example.com?some=%3Cparam" target="_blank">Link to a website!</a></p>');
});
it('must be able to deal with emoji in links', () => {
@ -207,7 +207,7 @@ describe('URL prompts', () => {
cy.previewOn();
cy.get('.EasyMDEContainer .editor-preview').should('contain.html', '<p><a href="https://example.com?some=%F0%9F%91%B7%E2%80%8D%E2%99%82%EF%B8%8F" target="_blank">Link to a 👌 website!</a></p>');
cy.get('.EasyMDEContainer .mde-editor-preview').should('contain.html', '<p><a href="https://example.com?some=%F0%9F%91%B7%E2%80%8D%E2%99%82%EF%B8%8F" target="_blank">Link to a 👌 website!</a></p>');
});
it('must be able to deal with spaces in links', () => {
@ -223,6 +223,6 @@ describe('URL prompts', () => {
cy.previewOn();
cy.get('.EasyMDEContainer .editor-preview').should('contain.html', '<p><a href="https://example.com?some=very%20special%20param" target="_blank">Link to a website!</a></p>');
cy.get('.EasyMDEContainer .mde-editor-preview').should('contain.html', '<p><a href="https://example.com?some=very%20special%20param" target="_blank">Link to a website!</a></p>');
});
});

Loading…
Cancel
Save