<p dir="auto">This pull request addresses <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="603851333" data-permission-text="Title is private" data-url="https://github.com/openstreetmap/openstreetmap-website/issues/2595" data-hovercard-type="issue" data-hovercard-url="/openstreetmap/openstreetmap-website/issues/2595/hovercard" href="https://github.com/openstreetmap/openstreetmap-website/issues/2595">#2595</a> , which involves re-enabling JavaScript unit tests. The goal is to restore JavaScript testing after the removal of Konacha. This work continues Andy's effort by cherry-picking commits from <a href="https://github.com/gravitystorm/openstreetmap-website/tree/teaspoon">his branch</a>, where the initial <a href="https://github.com/jejacks0n/teaspoon">Teaspoon</a> integration began.</p>
<h4 dir="auto">Key Updates:</h4>
<ul dir="auto">
<li><strong>Teaspoon Integration</strong>: Teaspoon has been configured to use Selenium WebDriver with Firefox (replacing PhantomJS, which is discontinued).</li>
<li><strong>GitHub CI</strong>: The GitHub test CI script has been updated to run JavaScript tests alongside the Rails tests.</li>
<li><strong>ESLint Adjustments</strong>: Added ESLint rules for the JavaScript test files in the <code class="notranslate">test</code> folder, fixing a few ESLint errors during the process.</li>
</ul>
<p dir="auto">At the moment, some tests are failing, you can look at the <a href="https://github.com/openstreetmap/openstreetmap-website/actions/runs/10863788529/job/30148346837">logs</a> for more details. This could be due to changes in implementation or other issues that I am investigating. Any advice on how to approach this would be highly appreciated. I also faced some caching problems inside Docker, but those should be resolved now.</p>
<p dir="auto">Note: This is still work in progress. I just wanted to get some feedback and to confirm this is going into right direction.</p>

<hr>

<h4>You can view, comment on, or merge this pull request online at:</h4>
<p>  <a href='https://github.com/openstreetmap/openstreetmap-website/pull/5216'>https://github.com/openstreetmap/openstreetmap-website/pull/5216</a></p>

<h4>Commit Summary</h4>
<ul>
  <li><a href="https://github.com/openstreetmap/openstreetmap-website/pull/5216/commits/c253545b0f1315a1f1feb4b9b2833a5243caa3d9" class="commit-link">c253545</a>  Use teaspoon to run javascript tests</li>
  <li><a href="https://github.com/openstreetmap/openstreetmap-website/pull/5216/commits/28957a0234e1dc1e0c057a73bbb6a718be67eefa" class="commit-link">28957a0</a>  Run javascript tests in CI</li>
  <li><a href="https://github.com/openstreetmap/openstreetmap-website/pull/5216/commits/57f6dab78422ac6b625ba99017892c65953d64cf" class="commit-link">57f6dab</a>  selenium driver working on local</li>
  <li><a href="https://github.com/openstreetmap/openstreetmap-website/pull/5216/commits/a801bf3257ea7d6250ed52edc77cc0c36865ba42" class="commit-link">a801bf3</a>  Use chai assertion style</li>
  <li><a href="https://github.com/openstreetmap/openstreetmap-website/pull/5216/commits/c7f2998347aefe228563ad8584215c0c399b6c67" class="commit-link">c7f2998</a>  Disable eslint for js test files to test for github-ci</li>
  <li><a href="https://github.com/openstreetmap/openstreetmap-website/pull/5216/commits/de9e0969e1df2c221c767201d60b4572f2f06813" class="commit-link">de9e096</a>  Add step for creation tmp/pids in test workflow</li>
  <li><a href="https://github.com/openstreetmap/openstreetmap-website/pull/5216/commits/91e8d556fe976b42a4aabfc594ac905304d37d3d" class="commit-link">91e8d55</a>  Enable eslint and fix eslint errors for osm_test.js</li>
</ul>

<h4 style="display: inline-block">File Changes </h4> <p style="display: inline-block">(<a href="https://github.com/openstreetmap/openstreetmap-website/pull/5216/files">8 files</a>)</p>
<ul>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/5216/files#diff-1db27d93186e46d3b441ece35801b244db8ee144ff1405ca27a163bfe878957f">.github/workflows/tests.yml</a>
    (4)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/5216/files#diff-d09ea66f8227784ff4393d88a19836f321c915ae10031d16c93d67e6283ab55f">Gemfile</a>
    (3)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/5216/files#diff-89cade48462044ee1b672dc5f4c3ec250fbd29effcd8932096a23c1283c6731f">Gemfile.lock</a>
    (6)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/5216/files#diff-96200efa07e00ed1e99917b67033ff3c54a932520a4dcb9939217a0e2fe1fa8b">config/eslint.js</a>
    (12)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/5216/files#diff-1dd5a8f580b9615769ddc19a64a98f455d9d20eb149c443f41d9d3c797d39b12">db/structure.sql</a>
    (7)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/5216/files#diff-94f48fb5b77f2e9e4d66ccbe5276b249c97182801b5213c866b744316d737a9f">test/javascripts/osm_test.js</a>
    (26)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/5216/files#diff-f55682cecede82529a2ca21b08c930157b91ea87b4c6e285f26cd2b4f234f094">test/javascripts/test_helper.js</a>
    (41)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/5216/files#diff-8ba5c7ef2ed0e6a6037c7aac729fd99db8c7bbbbbe54eea7d5e9136822a475b3">test/teaspoon_env.rb</a>
    (193)
  </li>
</ul>

<h4>Patch Links:</h4>
<ul>
  <li><a href='https://github.com/openstreetmap/openstreetmap-website/pull/5216.patch'>https://github.com/openstreetmap/openstreetmap-website/pull/5216.patch</a></li>
  <li><a href='https://github.com/openstreetmap/openstreetmap-website/pull/5216.diff'>https://github.com/openstreetmap/openstreetmap-website/pull/5216.diff</a></li>
</ul>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />Reply to this email directly, <a href="https://github.com/openstreetmap/openstreetmap-website/pull/5216">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAK2OLO46T3F2HO6XCDYXK3ZWRP5JAVCNFSM6AAAAABOG7LML6VHI2DSMVQWIX3LMV43ASLTON2WKOZSGUZDMNJQGEZDCNY">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AAK2OLOLY3Y75FNUTFPS7Y3ZWRP5JA5CNFSM6AAAAABOG7LML6WGG33NNVSW45C7OR4XAZNFJFZXG5LFVJRW63LNMVXHIX3JMTHJNF2ZME.gif" height="1" width="1" alt="" /><span style="color: transparent; font-size: 0; display: none; visibility: hidden; overflow: hidden; opacity: 0; width: 0; height: 0; max-width: 0; max-height: 0; mso-hide: all">Message ID: <span><openstreetmap/openstreetmap-website/pull/5216</span><span>@</span><span>github</span><span>.</span><span>com></span></span></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/openstreetmap/openstreetmap-website/pull/5216",
"url": "https://github.com/openstreetmap/openstreetmap-website/pull/5216",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>