code: def test_add_js_lib():
      """Tests for function add_js_lib.
  
      Checks that the html page contains the javascript code.
      """
      html = get_html_template("surface_plot_template.html")
      cdn = add_js_lib(html, embed_js=False)
      assert "decodeBase64" in cdn
      assert (
          _normalize_ws(
              """<script
      src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js">
      </script>
      <script src="https://cdn.plot.ly/plotly-gl3d-latest.min.js"></script>
      """
          )
          in _normalize_ws(cdn)
      )
      inline = _normalize_ws(add_js_lib(html, embed_js=True))
      assert (
          _normalize_ws(
              """/*! jQuery v3.6.0 | (c) OpenJS Foundation and other
                              contributors | jquery.org/license */"""
          )
          in inline
      )
      assert (
          _normalize_ws(
              """**
                              * plotly.js (gl3d - minified)"""
          )
          in inline
      )
      assert "decodeBase64" in inline
  
imports: import base64
  import os
  import re
  import tempfile
  import numpy
  import pytest
  from nilearn.datasets import fetch_surf_fsaverage
  from nilearn.plotting.js_plotting_utils import add_js_lib, colorscale, decode, encode, get_html_template, mesh_to_plotly, to_color_strings
  from nilearn.surface import load_surf_mesh
label_desc: Use image node_id 2 for calling a global function with example usage: test_add_js_lib() without return types