|
|
|
@ -11,7 +11,7 @@ describe('URL prompts', () => {
|
|
|
|
|
|
|
|
|
|
cy.window().then(($win) => {
|
|
|
|
|
const stub = cy.stub($win, 'prompt');
|
|
|
|
|
cy.get('button.link').click().then(() => {
|
|
|
|
|
cy.get('button.mde-link').click().then(() => {
|
|
|
|
|
expect(stub).to.be.calledWith('URL for the link:', 'https://');
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
@ -35,7 +35,7 @@ describe('URL prompts', () => {
|
|
|
|
|
|
|
|
|
|
cy.window().then(($win) => {
|
|
|
|
|
cy.stub($win, 'prompt').returns('https://example.com');
|
|
|
|
|
cy.get('button.link').click();
|
|
|
|
|
cy.get('button.mde-link').click();
|
|
|
|
|
});
|
|
|
|
|
cy.get('.EasyMDEContainer .CodeMirror').contains('[](https://example.com)');
|
|
|
|
|
cy.get('.EasyMDEContainer .CodeMirror').type('{home}{rightarrow}Link to a website!');
|
|
|
|
@ -52,7 +52,7 @@ describe('URL prompts', () => {
|
|
|
|
|
cy.window().then(($win) => {
|
|
|
|
|
const stub = cy.stub($win, 'prompt');
|
|
|
|
|
stub.returns('https://example.com');
|
|
|
|
|
cy.get('button.link').click().then(() => {
|
|
|
|
|
cy.get('button.mde-link').click().then(() => {
|
|
|
|
|
expect(stub).to.be.calledWith('URL for the link:', 'https://');
|
|
|
|
|
stub.restore();
|
|
|
|
|
});
|
|
|
|
@ -63,7 +63,7 @@ describe('URL prompts', () => {
|
|
|
|
|
cy.window().then(($win) => {
|
|
|
|
|
const stub = cy.stub($win, 'prompt');
|
|
|
|
|
stub.returns('https://example.eu');
|
|
|
|
|
cy.get('button.link').click().then(() => {
|
|
|
|
|
cy.get('button.mde-link').click().then(() => {
|
|
|
|
|
expect(stub).to.be.calledWith('URL for the link:', 'https://');
|
|
|
|
|
stub.restore();
|
|
|
|
|
});
|
|
|
|
@ -88,7 +88,7 @@ describe('URL prompts', () => {
|
|
|
|
|
|
|
|
|
|
cy.window().then(($win) => {
|
|
|
|
|
cy.stub($win, 'prompt').returns('https://example.com?some=param&moo=cow');
|
|
|
|
|
cy.get('button.link').click();
|
|
|
|
|
cy.get('button.mde-link').click();
|
|
|
|
|
});
|
|
|
|
|
cy.get('.EasyMDEContainer .CodeMirror').contains('[](https://example.com?some=param&moo=cow)');
|
|
|
|
|
cy.get('.EasyMDEContainer .CodeMirror').type('{home}{rightarrow}Link to a website!');
|
|
|
|
@ -104,7 +104,7 @@ describe('URL prompts', () => {
|
|
|
|
|
|
|
|
|
|
cy.window().then(($win) => {
|
|
|
|
|
cy.stub($win, 'prompt').returns('https://example.com?some=[]param');
|
|
|
|
|
cy.get('button.link').click();
|
|
|
|
|
cy.get('button.mde-link').click();
|
|
|
|
|
});
|
|
|
|
|
cy.get('.EasyMDEContainer .CodeMirror').contains('[](https://example.com?some=%5B%5Dparam)');
|
|
|
|
|
cy.get('.EasyMDEContainer .CodeMirror').type('{home}{rightarrow}Link to a website!');
|
|
|
|
@ -120,7 +120,7 @@ describe('URL prompts', () => {
|
|
|
|
|
|
|
|
|
|
cy.window().then(($win) => {
|
|
|
|
|
cy.stub($win, 'prompt').returns('https://example.com?some=(param)');
|
|
|
|
|
cy.get('button.link').click();
|
|
|
|
|
cy.get('button.mde-link').click();
|
|
|
|
|
});
|
|
|
|
|
cy.get('.EasyMDEContainer .CodeMirror').contains('[](https://example.com?some=\\(param\\))');
|
|
|
|
|
cy.get('.EasyMDEContainer .CodeMirror').type('{home}{rightarrow}Link to a website!');
|
|
|
|
@ -136,7 +136,7 @@ describe('URL prompts', () => {
|
|
|
|
|
|
|
|
|
|
cy.window().then(($win) => {
|
|
|
|
|
cy.stub($win, 'prompt').returns('https://example.com?some=(param1,param2)&more=(param3,param4)&end=true');
|
|
|
|
|
cy.get('button.link').click();
|
|
|
|
|
cy.get('button.mde-link').click();
|
|
|
|
|
});
|
|
|
|
|
cy.get('.EasyMDEContainer .CodeMirror').contains('[](https://example.com?some=\\(param1,param2\\)&more=\\(param3,param4\\)&end=true)');
|
|
|
|
|
cy.get('.EasyMDEContainer .CodeMirror').type('{home}{rightarrow}Link to a website!');
|
|
|
|
@ -152,7 +152,7 @@ describe('URL prompts', () => {
|
|
|
|
|
|
|
|
|
|
cy.window().then(($win) => {
|
|
|
|
|
cy.stub($win, 'prompt').returns('https://example.com?some=(param');
|
|
|
|
|
cy.get('button.link').click();
|
|
|
|
|
cy.get('button.mde-link').click();
|
|
|
|
|
});
|
|
|
|
|
cy.get('.EasyMDEContainer .CodeMirror').contains('[](https://example.com?some=\\(param)');
|
|
|
|
|
cy.get('.EasyMDEContainer .CodeMirror').type('{home}{rightarrow}Link to a website!');
|
|
|
|
@ -168,7 +168,7 @@ describe('URL prompts', () => {
|
|
|
|
|
|
|
|
|
|
cy.window().then(($win) => {
|
|
|
|
|
cy.stub($win, 'prompt').returns('https://example.com?some=)param');
|
|
|
|
|
cy.get('button.link').click();
|
|
|
|
|
cy.get('button.mde-link').click();
|
|
|
|
|
});
|
|
|
|
|
cy.get('.EasyMDEContainer .CodeMirror').contains('[](https://example.com?some=\\)param)');
|
|
|
|
|
cy.get('.EasyMDEContainer .CodeMirror').type('{home}{rightarrow}Link to a website!');
|
|
|
|
@ -184,7 +184,7 @@ describe('URL prompts', () => {
|
|
|
|
|
|
|
|
|
|
cy.window().then(($win) => {
|
|
|
|
|
cy.stub($win, 'prompt').returns('https://example.com?some=<param');
|
|
|
|
|
cy.get('button.link').click();
|
|
|
|
|
cy.get('button.mde-link').click();
|
|
|
|
|
});
|
|
|
|
|
cy.get('.EasyMDEContainer .CodeMirror').contains('[](https://example.com?some=%3Cparam');
|
|
|
|
|
cy.get('.EasyMDEContainer .CodeMirror').type('{home}{rightarrow}Link to a website!');
|
|
|
|
@ -200,7 +200,7 @@ describe('URL prompts', () => {
|
|
|
|
|
|
|
|
|
|
cy.window().then(($win) => {
|
|
|
|
|
cy.stub($win, 'prompt').returns('https://example.com?some=👷♂️');
|
|
|
|
|
cy.get('button.link').click();
|
|
|
|
|
cy.get('button.mde-link').click();
|
|
|
|
|
});
|
|
|
|
|
cy.get('.EasyMDEContainer .CodeMirror').contains('[](https://example.com?some=%F0%9F%91%B7%E2%80%8D%E2%99%82%EF%B8%8F');
|
|
|
|
|
cy.get('.EasyMDEContainer .CodeMirror').type('{home}{rightarrow}Link to a 👌 website!');
|
|
|
|
@ -216,7 +216,7 @@ describe('URL prompts', () => {
|
|
|
|
|
|
|
|
|
|
cy.window().then(($win) => {
|
|
|
|
|
cy.stub($win, 'prompt').returns('https://example.com?some=very special param');
|
|
|
|
|
cy.get('button.link').click();
|
|
|
|
|
cy.get('button.mde-link').click();
|
|
|
|
|
});
|
|
|
|
|
cy.get('.EasyMDEContainer .CodeMirror').contains('[](https://example.com?some=very%20special%20param');
|
|
|
|
|
cy.get('.EasyMDEContainer .CodeMirror').type('{home}{rightarrow}Link to a website!');
|
|
|
|
|