// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`empty.html 1`] = `
====================================options=====================================
parsers: ["html"]
printWidth: 80
                                                                                | printWidth
=====================================input======================================
<script></script>

=====================================output=====================================
<script></script>

================================================================================
`;

exports[`js.html 1`] = `
====================================options=====================================
parsers: ["html"]
printWidth: 80
                                                                                | printWidth
=====================================input======================================
<script type="text/javascript">
  var message = "Alert!";

  alert(message);
</script>
<script type="application/javascript">
  var message = "Alert!";

  alert(message);
</script>
<script>
  var message = "Alert!";

  alert(message);
</script>
<script type="text/babel">
            const    someJS    =   'this should be formatted'
</script>
<script type="module">
      import lib from './lib.js';
  
        function myFunction() { return 'foo'; }
  </script>

=====================================output=====================================
<script type="text/javascript">
  var message = "Alert!";

  alert(message);
</script>
<script type="application/javascript">
  var message = "Alert!";

  alert(message);
</script>
<script>
  var message = "Alert!";

  alert(message);
</script>
<script type="text/babel">
  const someJS = "this should be formatted";
</script>
<script type="module">
  import lib from "./lib.js";

  function myFunction() {
    return "foo";
  }
</script>

================================================================================
`;

exports[`simple.html 1`] = `
====================================options=====================================
parsers: ["html"]
printWidth: 80
                                                                                | printWidth
=====================================input======================================
<!DOCTYPE html>
<html>
  <head>
    <title>Sample styled page</title>
    <script>alert('test');</script>
    <script>
      var message = "Alert!";

      alert(message);
    </script>
  </head>
  <body>
    <h1>Sample styled page</h1>
    <p>This page is just a demo.</p>
  </body>
</html>

=====================================output=====================================
<!DOCTYPE html>
<html>
  <head>
    <title>Sample styled page</title>
    <script>
      alert("test");
    </script>
    <script>
      var message = "Alert!";

      alert(message);
    </script>
  </head>
  <body>
    <h1>Sample styled page</h1>
    <p>This page is just a demo.</p>
  </body>
</html>

================================================================================
`;

exports[`single-script.html 1`] = `
====================================options=====================================
parsers: ["html"]
printWidth: 80
                                                                                | printWidth
=====================================input======================================
<script>alert('test');</script>
<script>
  document.getElementById("demo").innerHTML = "Hello JavaScript!";
</script>

=====================================output=====================================
<script>
  alert("test");
</script>
<script>
  document.getElementById("demo").innerHTML = "Hello JavaScript!";
</script>

================================================================================
`;

exports[`something-else.html 1`] = `
====================================options=====================================
parsers: ["html"]
printWidth: 80
                                                                                | printWidth
=====================================input======================================
<script type="text/template">
 <div>
    </div>
</script>

=====================================output=====================================
<script type="text/template">
  <div>
     </div>
</script>

================================================================================
`;

exports[`template-literal.html 1`] = `
====================================options=====================================
parsers: ["html"]
printWidth: 80
                                                                                | printWidth
=====================================input======================================
<!DOCTYPE html>
<html lang="en">
    <head>
    </head>
    <body>
        <script>
            function foo() {
                return \`
                    <div>
                        <p>Text</p>
                    </div>
                \`;
            }
        </script>
    </body>
</html>

=====================================output=====================================
<!DOCTYPE html>
<html lang="en">
  <head> </head>
  <body>
    <script>
      function foo() {
        return \`
                    <div>
                        <p>Text</p>
                    </div>
                \`;
      }
    </script>
  </body>
</html>

================================================================================
`;

exports[`typescript.html 1`] = `
====================================options=====================================
parsers: ["html"]
printWidth: 80
                                                                                | printWidth
=====================================input======================================
<script type="application/x-typescript">
  class Student {
    fullName: string;
    constructor(public firstName: string, public middleInitial: string, public lastName: string) {
    this.fullName = firstName + " " + middleInitial + " " + lastName;
  }
  }

  interface Person {
    firstName: string;
    lastName: string;
  }

  function greeter(person : Person) {
    return "Hello, " + person.firstName + " " + person.lastName;
  }

  let user = new Student("Jane", "M.", "User");

  document.body.innerHTML = greeter(user);
</script>
<script lang="ts">
  class Student {
    fullName: string;
    constructor(public firstName: string, public middleInitial: string, public lastName: string) {
    this.fullName = firstName + " " + middleInitial + " " + lastName;
  }
  }

  interface Person {
    firstName: string;
    lastName: string;
  }

  function greeter(person : Person) {
    return "Hello, " + person.firstName + " " + person.lastName;
  }

  let user = new Student("Jane", "M.", "User");

  document.body.innerHTML = greeter(user);
</script>
<script lang="tsx">
  class CommentBox extends React.Component<{ url: string, pollInterval: number}, CommentData> {
    constructor(){
      super()
      this.state = { data: [] };
    }
    fetchComments() {
      $.ajax({
        url: this.props.url,
        dataType: 'json',
        cache: false,
        success: (data) => this.setState({ data: data }),
        error: (xhr, status, err) => console.error(status, err)
      })
    }
    componentDidMount() {
      this.fetchComments();
      setInterval(this.fetchComments.bind(this), this.props.pollInterval);
    }
    render() {
      let handleCommentSubmit = (comment: { author: string, text: string }) => {
        console.warn('comment submitted!', comment);
        const updated = this.state.data.slice(0);
        updated.push(comment);
        this.setState({ data: updated });
      }
      return (
        <div className="commentBox">
        <h1>Comments</h1>
        <CommentList data={this.state.data}/>
      <CommentForm onCommentSubmit={handleCommentSubmit} />
      </div>
    );
    }
  }
</script>

=====================================output=====================================
<script type="application/x-typescript">
  class Student {
    fullName: string;
    constructor(
      public firstName: string,
      public middleInitial: string,
      public lastName: string
    ) {
      this.fullName = firstName + " " + middleInitial + " " + lastName;
    }
  }

  interface Person {
    firstName: string;
    lastName: string;
  }

  function greeter(person: Person) {
    return "Hello, " + person.firstName + " " + person.lastName;
  }

  let user = new Student("Jane", "M.", "User");

  document.body.innerHTML = greeter(user);
</script>
<script lang="ts">
  class Student {
    fullName: string;
    constructor(
      public firstName: string,
      public middleInitial: string,
      public lastName: string
    ) {
      this.fullName = firstName + " " + middleInitial + " " + lastName;
    }
  }

  interface Person {
    firstName: string;
    lastName: string;
  }

  function greeter(person: Person) {
    return "Hello, " + person.firstName + " " + person.lastName;
  }

  let user = new Student("Jane", "M.", "User");

  document.body.innerHTML = greeter(user);
</script>
<script lang="tsx">
  class CommentBox extends React.Component<
    { url: string; pollInterval: number },
    CommentData
  > {
    constructor() {
      super();
      this.state = { data: [] };
    }
    fetchComments() {
      $.ajax({
        url: this.props.url,
        dataType: "json",
        cache: false,
        success: data => this.setState({ data: data }),
        error: (xhr, status, err) => console.error(status, err)
      });
    }
    componentDidMount() {
      this.fetchComments();
      setInterval(this.fetchComments.bind(this), this.props.pollInterval);
    }
    render() {
      let handleCommentSubmit = (comment: { author: string; text: string }) => {
        console.warn("comment submitted!", comment);
        const updated = this.state.data.slice(0);
        updated.push(comment);
        this.setState({ data: updated });
      };
      return (
        <div className="commentBox">
          <h1>Comments</h1>
          <CommentList data={this.state.data} />
          <CommentForm onCommentSubmit={handleCommentSubmit} />
        </div>
      );
    }
  }
</script>

================================================================================
`;
