<commit_before>import Help from "./../../src/js/user/Help";
import React from "react";
import { shallow } from "enzyme";
import { expect } from "chai";
import Locale from "./../../src/js/utils/Locale";
import sinon from "sinon";

describe("Help", () => {
    let helpDom = null, FAQs = null;
    const sandbox = sinon.sandbox.create();
    beforeEach("Help", () => {
        FAQs = [{
            "question": "What is the purpose of the application?",
            "answer": "To act as an aggregator for news items from different sources like RSS feeds, Facebook Page and Twitter Handles or Hashtags"
        }];
        sandbox.stub(Locale, "applicationStrings").returns({
            "messages": {
                "helpFAQs": {
                    "help": "Help",
                    "FAQsHeading": "FAQs",
                    "FAQs": [
                        {
                            "question": "What is the purpose of the application?",
                            "answer": "To act as an aggregator for news items from different sources like RSS feeds, Facebook Page and Twitter Handles or Hashtags"
                        }
                    ]
                }
            }
        });
        helpDom = shallow(<Help FAQs={FAQs}/>);
    });

    afterEach("Help", () => {
        sandbox.restore();
    });

    it("should have help&FAQs div", () => {
        expect(helpDom.node.type).to.equals("div");
        expect(helpDom.node.props.className).to.equals("help-FAQs");
    });

    it("should have help div", () => {
        const [help] = helpDom.node.props.children;
        expect(help.type).to.equals("div");
        expect(help.props.className).to.equals("help");
    });

    it("should have video", () => {
        const [help] = helpDom.node.props.children;
        const [, video] = help.props.children;
        expect(video.type).to.equals("div");
        expect(video.props.className).to.equals("video");
        expect(video.props.children.type).to.equals("i");
        expect(video.props.children.props.className).to.equals("icon fa fa-play");
    });

    it("should have heading help", () => {
        const [help] = helpDom.node.props.children;
        const [heading] = help.props.children;
        expect(heading.type).to.equals("h3");
        expect(heading.props.children).to.equals("Help");
    });

    it("should have FAQs div", () => {
        const [, FAQS] = helpDom.node.props.children;
        expect(FAQS.type).to.equals("div");
        expect(FAQS.props.className).to.equals("FAQs");
    });

    it("should have heading FAQs", () => {
        const [, FAQS] = helpDom.node.props.children;
        const [heading] = FAQS.props.children;
        expect(heading.type).to.equals("h3");
        expect(heading.props.children).to.equals("FAQs");
    });<commit_msg>[Rav] updated help page test<commit_after>import Help from "./../../src/js/user/Help";
import React from "react";
import { shallow } from "enzyme";
import { expect } from "chai";
import Locale from "./../../src/js/utils/Locale";
import sinon from "sinon";

describe("Help", () => {
    let helpDom = null, FAQs = null;
    const sandbox = sinon.sandbox.create();
    beforeEach("Help", () => {
        FAQs = [{
            "question": "What is the purpose of the application?",
            "answer": "To act as an aggregator for news items from different sources like RSS feeds, Facebook Page and Twitter Handles or Hashtags"
        }];
        sandbox.stub(Locale, "applicationStrings").returns({
            "messages": {
                "helpFAQs": {
                    "help": "Help",
                    "FAQsHeading": "FAQs",
                    "FAQs": [
                        {
                            "question": "What is the purpose of the application?",
                            "answer": "To act as an aggregator for news items from different sources like RSS feeds, Facebook Page and Twitter Handles or Hashtags"
                        }
                    ]
                }
            }
        });
        helpDom = shallow(<Help FAQs={FAQs}/>);
    });

    afterEach("Help", () => {
        sandbox.restore();
    });

    it("should have help&FAQs div", () => {
        expect(helpDom.node.type).to.equals("div");
        expect(helpDom.node.props.className).to.equals("help-FAQs");
    });

    it("should have help div", () => {
        const [help] = helpDom.node.props.children;
        expect(help.type).to.equals("div");
        expect(help.props.className).to.equals("help");
    });

    it("should have video", () => {
        const [help] = helpDom.node.props.children;
        const [, video] = help.props.children;
        expect(video.type).to.equals("div");
        expect(video.props.className).to.equals("video");
    });

    it("should have heading help", () => {
        const [help] = helpDom.node.props.children;
        const [heading] = help.props.children;
        expect(heading.type).to.equals("h3");
        expect(heading.props.children).to.equals("Help");
    });

    it("should have FAQs div", () => {
        const [, FAQS] = helpDom.node.props.children;
        expect(FAQS.type).to.equals("div");
        expect(FAQS.props.className).to.equals("FAQs");
    });

    it("should have heading FAQs", () => {
        const [, FAQS] = helpDom.node.props.children;
        const [heading] = FAQS.props.children;
        expect(heading.type).to.equals("h3");
        expect(heading.props.children).to.equals("FAQs");
    });
{'fraction_non_alphanumeric': 0.16333212077118953, 'fraction_numerical': 0.0007275372862859222, 'mean_word_length': 2.063509749303621, 'pattern_counts': {'":': 18, '<': 5, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4865748', 'n_tokens_mistral': 1638, 'n_tokens_neox': 1570, 'n_words': 344}