<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Shaan Builds Development Notes]]></title><description><![CDATA[Shaan Builds Development Notes]]></description><link>https://shaanbuilds.hashnode.dev</link><image><url>https://cdn.hashnode.com/uploads/logos/6aec2877bc226ae6c39fa56b/949fc87e-b2fc-4ac2-8ae4-b696ff34c868.png</url><title>Shaan Builds Development Notes</title><link>https://shaanbuilds.hashnode.dev</link></image><generator>RSS for Node</generator><lastBuildDate>Wed, 18 Nov 2026 13:20:43 GMT</lastBuildDate><atom:link href="https://shaanbuilds.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[How to test redirects before handing over a website redesign]]></title><description><![CDATA[A redesign can pass a click-through of the new site while old links are still broken. Before handover, take a sample of URLs from the old site and record…]]></description><link>https://shaanbuilds.hashnode.dev/how-to-test-redirects-before-handing-over-a-website-redesign</link><guid isPermaLink="true">https://shaanbuilds.hashnode.dev/how-to-test-redirects-before-handing-over-a-website-redesign</guid><dc:creator><![CDATA[Shantanu Sahay]]></dc:creator><pubDate>Mon, 16 Nov 2026 07:18:33 GMT</pubDate><content:encoded><![CDATA[<p>A redesign can pass a click-through of the new site while old links are still broken. Before handover, take a sample of URLs from the old site and record where each one should go. Start with pages people already link to, pages that receive search traffic, and links used in emails or printed material.</p>
<h2>Give each old URL an expected result</h2>
<p>Create four columns: <strong>old URL, expected destination, observed result, and next action</strong>. An old service page with a clear replacement should lead to that replacement. A retired page with no equivalent can return <code>404</code> or <code>410</code>. Sending every retired page to the homepage makes it harder for visitors to tell what happened.</p>
<p>For a made-up bakery, <code>/cakes/wedding-cakes</code> might move to <code>/wedding-cakes</code>. A past hiring announcement might simply be removed. A link with a tracking parameter is worth testing too. Check useful parameters, such as one that selects a product or language, separately from tracking parameters.</p>
<h2>Check the first response and the final page</h2>
<p>Run these against an old URL you control. Replace the illustrative address with your own. The first command shows the old response headers. The second follows redirects and prints the final HTTP status, destination, and number of redirect hops.</p>
<pre><code class="language-sh">curl -sS -D - -o /dev/null https://example.com/cakes/wedding-cakes
curl -sS -L --max-redirs 5 -o /dev/null \
  -w 'status=%{http_code} url=%{url_effective} hops=%{num_redirects}\n' \
  https://example.com/cakes/wedding-cakes
</code></pre>
<p>On Windows PowerShell, use <code>curl.exe</code>, replace <code>/dev/null</code> with <code>NUL</code>, and put each command on one line. These examples use a GET request because it is the request a visitor makes when following a link.</p>
<ul>
<li>For a permanent move, look for <code>301</code> or <code>308</code> on the old URL, a <code>Location</code> header pointing to the right page, and a final <code>200</code> on that page.</li>
<li>A final <code>200</code> alone can hide a redirect to a homepage or an error message that returns a success status. Open the destination and check the title and the task the visitor came to complete.</li>
<li>If you see several hops, check whether the old URL can point straight to the final page. If the command exits after too many redirects, check for a loop.</li>
<li>If you expect <code>404</code> or <code>410</code>, record the observed status and check that the error page gives visitors a way to find useful content.</li>
</ul>
<h2>Keep the redirect map after launch</h2>
<p>Save the sample and note when it was tested. Add new internal links to the final URLs so routine navigation doesn't depend on redirects. Recheck a few old links after the next deploy, especially if the hosting or routing configuration changed.</p>
<p>For the related work on finding priority pages and keeping them current, see the <a href="https://shaanbuilds.com/guides/small-business-seo-plan/">small-business SEO plan</a>.</p>
<p><em>Written for Shaan Builds Development Notes with AI writing assistance. The bakery and URLs above are illustrative.</em></p>
]]></content:encoded></item><item><title><![CDATA[What to test before handing over a contact form]]></title><description><![CDATA[A practical acceptance checklist for form validation, request failures, keyboard use and the receiving workflow, with a small JavaScript example.]]></description><link>https://shaanbuilds.hashnode.dev/what-to-test-before-handing-over-a-contact-form</link><guid isPermaLink="true">https://shaanbuilds.hashnode.dev/what-to-test-before-handing-over-a-contact-form</guid><category><![CDATA[webdev]]></category><category><![CDATA[JavaScript]]></category><category><![CDATA[Accessibility]]></category><category><![CDATA[Testing]]></category><dc:creator><![CDATA[Shantanu Sahay]]></dc:creator><pubDate>Thu, 05 Nov 2026 07:18:32 GMT</pubDate><content:encoded><![CDATA[<p>A contact form needs an agreed test from the visitor's first field to the business's receiving workflow. Before a handover, write down what counts as acceptance: which inbox or system receives the enquiry, what the visitor sees, and who checks both ends.</p>
<p>Use made-up details during development. For the example here, the visitor is Casey Example at <code>casey@example.com</code>, asking an illustrative question about an appointment. The form and its local mock endpoint do not send email.</p>
<h2>Start with fields you can explain</h2>
<p>Give every control a visible label. Associate the label's <code>for</code> value with the input's <code>id</code>; a placeholder disappears when someone types and should not carry the only instruction. The <a href="https://www.w3.org/WAI/tutorials/forms/labels/">W3C form-label tutorial</a> explains this association.</p>
<p>Use <code>type="email"</code> and <code>required</code> where they match the brief. Agree on length limits too. A message limit of 2,000 characters is an example choice here, not a universal requirement. Tell the visitor about the limit before they reach it.</p>
<p>Run these checks with the actual browser UI:</p>
<ul>
<li>Submit the empty form. Does it identify a required field?</li>
<li>Enter an obviously invalid email value, such as <code>not-an-address</code>.</li>
<li>Click each label and check that the corresponding control gets focus.</li>
<li>Paste a long message and check the agreed limit.</li>
</ul>
<p>The <a href="https://developer.mozilla.org/en-US/docs/Learn_web_development/Extensions/Forms/Form_validation">MDN form-validation guide</a> covers browser constraints and their limits. Keep server-side validation in the implementation plan: browser checks can be bypassed. An email input's format check also cannot establish that a mailbox exists.</p>
<p>The example uses this markup:</p>
<pre><code class="language-html">&lt;form id="enquiry" action="/contact" method="post"&gt;
  &lt;label for="name"&gt;Name (required)&lt;/label&gt;
  &lt;input id="name" name="name" autocomplete="name" required maxlength="100"&gt;
  &lt;label for="email"&gt;Email (required)&lt;/label&gt;
  &lt;input id="email" name="email" type="email" autocomplete="email" required maxlength="254"&gt;
  &lt;label for="message"&gt;Message (required, up to 2,000 characters)&lt;/label&gt;
  &lt;textarea id="message" name="message" required maxlength="2000"&gt;&lt;/textarea&gt;
  &lt;button type="submit"&gt;Send enquiry&lt;/button&gt;
  &lt;p id="status" role="status"&gt;&lt;/p&gt;
&lt;/form&gt;
</code></pre>
<h2>Exercise the response handling</h2>
<p>Use a small, explicit response contract. In this illustrative handler, the endpoint must return a successful HTTP status and JSON with <code>accepted: true</code>. Only then does the form clear its fields. Capture the submitted values before disabling the controls, so they remain in the request body.</p>
<pre><code class="language-javascript">const form = document.querySelector("#enquiry");
const status = document.querySelector("#status");
let sending = false;

form.addEventListener("submit", async (event) =&gt; {
  event.preventDefault();
  if (sending) return;
  const body = new URLSearchParams(new FormData(form));
  const controls = [...form.elements].filter(control =&gt; !control.disabled);
  sending = true;
  controls.forEach(control =&gt; { control.disabled = true; });
  status.textContent = "Sending your enquiry...";
  try {
    const response = await fetch(form.action, {
      method: "POST",
      body,
      headers: { "Accept": "application/json" }
    });
    if (!response.ok) throw new Error("HTTP failure");
    const result = await response.json();
    if (result.accepted !== true) throw new Error("Not accepted");
    status.textContent = "Your enquiry was accepted.";
    form.reset();
  } catch {
    status.textContent = "We couldn't confirm this enquiry. Your text is still here. Check the connection before trying again.";
  } finally {
    sending = false;
    controls.forEach(control =&gt; { control.disabled = false; });
  }
});
</code></pre>
<p>This assumes a form with <code>id="enquiry"</code>, a submit button and an initially empty element with <code>id="status"</code> and <code>role="status"</code>. Its named controls should be labelled and have the constraints agreed for the project. The form's <code>action</code> is the endpoint you are testing. The controls stay disabled while the request is pending, which prevents newer, unsent edits from being cleared by the earlier response.</p>
<p>MDN documents that <a href="https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch">fetch can resolve even when the HTTP response is an error</a>. Check <code>response.ok</code> before treating the request as successful. Its <a href="https://developer.mozilla.org/en-US/docs/Web/API/Response/ok">meaning is an HTTP status from 200 through 299</a>; it does not prove that a notification reached an inbox. The <code>accepted</code> field is an example application contract, which your backend must actually implement.</p>
<p>Test more than the successful response:</p>
<table>
<thead>
<tr>
<th>Response or action</th>
<th>Expected result</th>
</tr>
</thead>
<tbody><tr>
<td>Slow request</td>
<td>A visible pending message; fields and the submit button are disabled</td>
</tr>
<tr>
<td>A second submit while pending</td>
<td>No second request from this handler</td>
</tr>
<tr>
<td>HTTP 503</td>
<td>Input remains; a useful message replaces the pending state</td>
</tr>
<tr>
<td>HTTP 200 with <code>accepted: false</code></td>
<td>Input remains; no success claim</td>
</tr>
<tr>
<td>Invalid JSON or a failed network request</td>
<td>Input remains and the button becomes usable again</td>
</tr>
<tr>
<td>HTTP 202 with <code>accepted: true</code></td>
<td>The accepted message appears and fields clear</td>
</tr>
</tbody></table>
<p>Disabling the controls covers this interaction in this page. A production system may also need a request identifier or another server-side approach so retries cannot create unwanted duplicates. A connection failure can leave the outcome unknown.</p>
<h2>Check the form without a mouse</h2>
<p>Tab through the fields in their visual order. Keep focus visible. Check whether you can submit from the keyboard, correct an invalid field and reach any alternative contact route.</p>
<p>Put the status region in the page before the request starts, then update its text. <a href="https://www.w3.org/WAI/WCAG22/Techniques/aria/ARIA22">W3C's ARIA22 technique</a> describes using <code>role="status"</code> for status messages. Test the result with the assistive technology and browsers agreed for the project; the attribute alone is not a completed accessibility review.</p>
<p>Repeat the check at a narrow width and with enlarged text. A clipped message or an off-screen button can prevent the visitor from finishing even when the request code works.</p>
<h2>Finish the receiving-workflow check</h2>
<p>For a real integration, submit an agreed dummy enquiry and have the business check the actual receiving inbox or system. Verify the message content, reply route and any notification used by the person who handles enquiries. Agree on a sensible observation window and record what arrived.</p>
<p>Keep the browser result and receiving result separate in the handover notes. Write down the environment, test data, expected result, observed result and person responsible for a failed check. Any deferred work should have an owner before the build is approved.</p>
<p>Shantanu Sahay builds websites and apps independently at <a href="https://shaanbuilds.com/?prices=usd">Shaan Builds</a>. For a project discussion, email <a href="mailto:hello@shaanbuilds.com">hello@shaanbuilds.com</a>.</p>
<p>This article was prepared with AI assistance. The illustrative example passed local browser checks using made-up data and a mock endpoint; no real email delivery or screen-reader audit was tested.</p>
]]></content:encoded></item></channel></rss>