From ee5c8cace360b8d932148b0c603a93b6a4faf7ba Mon Sep 17 00:00:00 2001 From: DIBSTER <76603072+DEV-DIBSTER@users.noreply.github.com> Date: Thu, 5 Dec 2024 18:47:46 -0500 Subject: [PATCH] Update domains.test.js --- tests/domains.test.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/domains.test.js b/tests/domains.test.js index 980f9d87..cfb019e3 100644 --- a/tests/domains.test.js +++ b/tests/domains.test.js @@ -27,7 +27,7 @@ t("Nested subdomains should not exist without a valid parent domain", (t) => { // First-level subdomains have no immediate parent to check if (subdomain.split(".").length > 3) { // Get the immediate parent domain (remove the first subdomain part) - const parentSubdomain = subdomain.split(".").slice(1).join("."); + const parentSubdomain = subdomain.split(".").slice(-3).join("."); // Ensure the immediate parent subdomain exists in the list of files t.true( @@ -54,7 +54,7 @@ t("Nested subdomains should not exist if the parent domain has NS records", (t) // First-level subdomains have no immediate parent to check if (subdomain.split(".").length > 3) { // Get the immediate parent domain, by getting the last 3 parts. - const parentSubdomain = subdomain.split(".").slice(-3); + const parentSubdomain = subdomain.split(".").slice(-3).join("."); const parentFilePath = path.join(domainsPath, `${parentSubdomain}.json`); // Check if the parent file exists before attempting to read it