-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'decaporg:master' into widget-boolean
- Loading branch information
Showing
260 changed files
with
9,685 additions
and
7,739 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { defineConfig } from 'cypress'; | ||
|
||
export default defineConfig({ | ||
projectId: '1c35bs', | ||
retries: { | ||
runMode: 4, | ||
openMode: 0, | ||
}, | ||
e2e: { | ||
video: false, | ||
// We've imported your old cypress plugins here. | ||
// You may want to clean this up later by importing these. | ||
setupNodeEvents(on, config) { | ||
// eslint-disable-next-line @typescript-eslint/no-var-requires | ||
return require('./cypress/plugins/index.js')(on, config); | ||
}, | ||
baseUrl: 'http://localhost:8080', | ||
specPattern: 'cypress/e2e/*spec*.js', | ||
}, | ||
}); |
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,135 @@ | ||
import { oneLineTrim, stripIndent } from 'common-tags'; | ||
import '../utils/dismiss-local-backup'; | ||
|
||
describe('Markdown widget code block', () => { | ||
before(() => { | ||
Cypress.config('defaultCommandTimeout', 4000); | ||
cy.task('setupBackend', { backend: 'test' }); | ||
}); | ||
|
||
beforeEach(() => { | ||
cy.loginAndNewPost(); | ||
cy.clearMarkdownEditorContent(); | ||
}); | ||
|
||
after(() => { | ||
cy.task('teardownBackend', { backend: 'test' }); | ||
}); | ||
describe('code block', () => { | ||
it('outputs code', () => { | ||
// eslint-disable-next-line cypress/no-unnecessary-waiting | ||
cy | ||
.insertCodeBlock() | ||
.type('foo') | ||
.enter() | ||
.type('bar') | ||
.confirmMarkdownEditorContent( | ||
` | ||
${codeBlock(` | ||
foo | ||
bar | ||
`)} | ||
`, | ||
) | ||
.wait(500) | ||
.clickModeToggle().confirmMarkdownEditorContent(` | ||
${codeBlockRaw(` | ||
foo | ||
bar | ||
`)} | ||
`); | ||
}); | ||
}); | ||
}); | ||
|
||
function codeBlockRaw(content) { | ||
return ['```', ...stripIndent(content).split('\n'), '```'] | ||
.map( | ||
line => oneLineTrim` | ||
<div> | ||
<span> | ||
<span> | ||
<span>${line}</span> | ||
</span> | ||
</span> | ||
</div> | ||
`, | ||
) | ||
.join(''); | ||
} | ||
|
||
function codeBlock(content) { | ||
const lines = stripIndent(content) | ||
.split('\n') | ||
.map( | ||
(line, idx) => ` | ||
<div> | ||
<div> | ||
<div>${idx + 1}</div> | ||
</div> | ||
<pre><span>${line}</span></pre> | ||
</div> | ||
`, | ||
) | ||
.join(''); | ||
|
||
return oneLineTrim` | ||
<div> | ||
<div></div> | ||
<div> | ||
<div><label>Code Block </label> | ||
<div><button><span><svg> | ||
<path></path> | ||
</svg></span></button> | ||
<div> | ||
<div> | ||
<div><textarea></textarea></div> | ||
<div> | ||
<div></div> | ||
</div> | ||
<div> | ||
<div></div> | ||
</div> | ||
<div></div> | ||
<div></div> | ||
<div> | ||
<div> | ||
<div> | ||
<div> | ||
<div> | ||
<div> | ||
<pre><span>xxxxxxxxxx</span></pre> | ||
</div> | ||
<div></div> | ||
<div></div> | ||
<div> | ||
<div> </div> | ||
</div> | ||
<div> | ||
${lines} | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
<div></div> | ||
<div> | ||
<div></div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
<div> | ||
<span> | ||
<span> | ||
<span></span> | ||
</span> | ||
</span> | ||
</div> | ||
</div> | ||
<div></div> | ||
</div> | ||
`; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.