freeCodeCamp/curriculum/challenges/arabic/03-front-end-libraries/react/create-a-stateless-function...

1.5 KiB

id title challengeType isRequired videoUrl localeTitle
5a24c314108439a4d4036162 Create a Stateless Functional Component 6 false إنشاء مكون وظيفي عديم الحالة

Description

undefined

Instructions

undefined

Tests

tests:
  - text: يجب على <code>MyComponent</code> إرجاع JSX.
    testString: 'assert((function() { const mockedComponent = Enzyme.mount(React.createElement(MyComponent)); return mockedComponent.length === 1; })(), "<code>MyComponent</code> should return JSX.");'
  - text: ''
    testString: 'assert((function() { const mockedComponent = Enzyme.mount(React.createElement(MyComponent)); return mockedComponent.children().type() === "div" })(), "<code>MyComponent</code> should return a <code>div</code> element.");'
  - text: يجب أن يحتوي عنصر <code>div</code> على سلسلة من النص.
    testString: 'assert((function() { const mockedComponent = Enzyme.mount(React.createElement(MyComponent)); return mockedComponent.find("div").text() !== ""; })(), "The <code>div</code> element should contain a string of text.");'

Challenge Seed

const MyComponent = function() {
  // change code below this line



  // change code above this line
}

After Test

console.info('after the test');

Solution

// solution required