MCPcopy Create free account
hub / github.com/freeCodeCamp/freeCodeCamp / replaceTextInCodeEditor

Function replaceTextInCodeEditor

e2e/output.spec.ts:31–49  ·  view source on GitHub ↗
({
  page,
  browserName,
  isMobile,
  text,
  containerId = 'editor-container-indexhtml'
}: InsertTextParameters)

Source from the content-addressed store, hash-verified

29}
30
31const replaceTextInCodeEditor = async ({
32 page,
33 browserName,
34 isMobile,
35 text,
36 containerId = 'editor-container-indexhtml'
37}: InsertTextParameters) => {
38 await expect(async () => {
39 await clearEditor({ page, browserName, isMobile });
40 await getEditors(page).fill(text);
41 await expect(page.getByTestId(containerId)).toContainText(text);
42
43 await expect(
44 page.getByRole('region', {
45 name: translations.learn['editor-tabs'].console
46 })
47 ).toContainText('Your test output will go here');
48 }).toPass();
49};
50
51const runChallengeTest = async (page: Page, isMobile: boolean) => {
52 if (isMobile) {

Callers 1

output.spec.tsFile · 0.85

Calls 2

clearEditorFunction · 0.90
getEditorsFunction · 0.90

Tested by

no test coverage detected