<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Kalyan Bhattarai</title>
    <description>The latest articles on DEV Community by Kalyan Bhattarai (@kalyanbhattarai).</description>
    <link>https://dev.to/kalyanbhattarai</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4282784%2Fd39e7e4c-4feb-4fdd-a7a4-3c75a5d74025.jpg</url>
      <title>DEV Community: Kalyan Bhattarai</title>
      <link>https://dev.to/kalyanbhattarai</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/kalyanbhattarai"/>
    <language>en</language>
    <item>
      <title>920 passing tests, perfect Lighthouse scores, and a button nobody could read</title>
      <dc:creator>Kalyan Bhattarai</dc:creator>
      <pubDate>Fri, 04 Dec 2026 12:42:11 +0000</pubDate>
      <link>https://dev.to/kalyanbhattarai/920-passing-tests-perfect-lighthouse-scores-and-a-button-nobody-could-read-5bk2</link>
      <guid>https://dev.to/kalyanbhattarai/920-passing-tests-perfect-lighthouse-scores-and-a-button-nobody-could-read-5bk2</guid>
      <description>&lt;p&gt;I thought my website was ready for production.&lt;/p&gt;

&lt;p&gt;The automated tests were passing. The Lighthouse scores looked great. There were no reported dependency vulnerabilities. After spending hours checking everything, I was pretty confident about the release.&lt;/p&gt;

&lt;p&gt;Then I opened my running pace calculator during manual staging verification and noticed something strange.&lt;/p&gt;

&lt;p&gt;There was a white button with absolutely no visible text.&lt;/p&gt;

&lt;p&gt;When I moved my mouse over it, the words "Download Splits (CSV)" appeared.&lt;/p&gt;

&lt;p&gt;Move the mouse away, and they disappeared again.&lt;/p&gt;

&lt;p&gt;Something that was obvious to a human had slipped through hundreds of automated tests.&lt;/p&gt;

&lt;h2&gt;
  
  
  What actually caused the problem?
&lt;/h2&gt;

&lt;p&gt;I was using a reusable Button component with predefined Tailwind CSS variants.&lt;/p&gt;

&lt;p&gt;The download button used an outline variant, but I was also passing custom background and text colors through its className.&lt;/p&gt;

&lt;p&gt;The outline variant included a white background and dark text. The custom classes requested a blue background and white text.&lt;/p&gt;

&lt;p&gt;Because the component simply concatenated the classes, the final result depended on their order in the generated CSS stylesheet.&lt;/p&gt;

&lt;p&gt;The browser ended up rendering white text on a white background.&lt;/p&gt;

&lt;p&gt;The hover styles happened to change the text color, which explained why the label became visible when I moved my mouse over it.&lt;/p&gt;

&lt;p&gt;It wasn't a complicated bug. It was a fairly simple styling conflict that had gone unnoticed.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why didn't the tests catch it?
&lt;/h2&gt;

&lt;p&gt;This was the part that made me reconsider my testing approach.&lt;/p&gt;

&lt;p&gt;My existing automated tests were primarily checking functionality. They could confirm that a button existed, that calculations returned the expected values, and that the download function worked.&lt;/p&gt;

&lt;p&gt;But the existence of a button doesn't mean a user can actually read it.&lt;/p&gt;

&lt;p&gt;Similarly, Lighthouse was testing the page under specific conditions. A passing accessibility audit doesn't guarantee that every interactive state and every control has been inspected.&lt;/p&gt;

&lt;p&gt;I had been treating different types of testing as though they were interchangeable.&lt;/p&gt;

&lt;p&gt;They aren't.&lt;/p&gt;

&lt;h2&gt;
  
  
  One bug turned into a much bigger discovery
&lt;/h2&gt;

&lt;p&gt;Instead of immediately fixing the single button and deploying again, I decided to investigate whether the same styling conflict existed elsewhere.&lt;/p&gt;

&lt;p&gt;The problem appeared in several other calculators, including BMI, TDEE, mortgage refinancing, credit card payoff, and retirement calculators.&lt;/p&gt;

&lt;p&gt;Some buttons had poor contrast when hovered over. Others had conflicting background styles.&lt;/p&gt;

&lt;p&gt;The broader audit also uncovered additional accessibility issues and a React hydration mismatch in my regex tester.&lt;/p&gt;

&lt;p&gt;That hydration issue was particularly interesting. The component displayed regex execution time during its initial render. Since the execution time differed between server rendering and browser hydration, React encountered a text mismatch.&lt;/p&gt;

&lt;p&gt;Making the initial timing value deterministic and updating it after hydration resolved the issue.&lt;/p&gt;

&lt;h2&gt;
  
  
  Changing my testing strategy
&lt;/h2&gt;

&lt;p&gt;My website contains 67 utilities, so manually opening every tool after every release isn't particularly practical.&lt;/p&gt;

&lt;p&gt;I introduced browser-level checks using Chrome DevTools Protocol (CDP) to complement the existing unit tests and Lighthouse audits.&lt;/p&gt;

&lt;p&gt;The browser checks now inspect things such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Actual computed foreground and background colors.&lt;/li&gt;
&lt;li&gt;Button visibility and contrast.&lt;/li&gt;
&lt;li&gt;Horizontal overflow on mobile devices.&lt;/li&gt;
&lt;li&gt;Broken images.&lt;/li&gt;
&lt;li&gt;Browser console and runtime errors.&lt;/li&gt;
&lt;li&gt;Selected interactive workflows and downloads.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;All 67 tool routes are inspected on desktop and mobile. Deeper interaction testing currently covers a smaller subset of tools, so there is still work to do.&lt;/p&gt;

&lt;p&gt;The automated regression script was also tested with a simulated failure to confirm that it actually returns a failing exit code.&lt;/p&gt;

&lt;p&gt;By the end of the maintenance release, the automated test count had increased to 922, and the live Lighthouse audits passed across eight representative routes on both mobile and desktop.&lt;/p&gt;

&lt;p&gt;But this time, I understood what those results did and didn't mean.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I learned
&lt;/h2&gt;

&lt;p&gt;A unit test can tell me whether a function works.&lt;/p&gt;

&lt;p&gt;A browser test can tell me whether the interface behaves as expected.&lt;/p&gt;

&lt;p&gt;Lighthouse can identify performance, accessibility, and SEO issues under its audit conditions.&lt;/p&gt;

&lt;p&gt;And manual testing can help me notice things I never thought to write a test for.&lt;/p&gt;

&lt;p&gt;None of these approaches is a complete replacement for the others.&lt;/p&gt;

&lt;p&gt;As an independent developer, it's tempting to rely on a dashboard full of green numbers. It feels like evidence that everything is working.&lt;/p&gt;

&lt;p&gt;Sometimes, though, the most useful test is simply opening your own website and trying to use it like an ordinary visitor.&lt;/p&gt;

&lt;p&gt;I'm curious how other developers approach this.&lt;/p&gt;

&lt;p&gt;Do you have a reliable automated strategy for catching visual defects across large numbers of pages, or do you still rely heavily on manual smoke testing before production releases?&lt;/p&gt;




&lt;p&gt;Disclosure: This article is based on my actual project development, debugging and deployment experience. AI helped me organize and draft the article.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>testing</category>
      <category>javascript</category>
      <category>a11y</category>
    </item>
  </channel>
</rss>
