diff --git a/backend/src/components/cache.js b/backend/src/components/cache.js index b16c7f36..c5a41b70 100644 --- a/backend/src/components/cache.js +++ b/backend/src/components/cache.js @@ -2,7 +2,8 @@ const NodeCache = require("node-cache"); const listCache = new NodeCache({ stdTTL: 21600 }); const schoolCache = new NodeCache({ stdTTL: 21600 }); const codeCache = new NodeCache({ stdTTL: 21600 }); +const fileCache = new NodeCache({ stdTTL: 21600 }); module.exports = { - listCache,schoolCache,codeCache + listCache,schoolCache,codeCache, fileCache }; \ No newline at end of file diff --git a/backend/src/components/utils.js b/backend/src/components/utils.js index 4ab7baef..070131a4 100644 --- a/backend/src/components/utils.js +++ b/backend/src/components/utils.js @@ -1,29 +1,8 @@ const ALLOWED_FILENAMES = new Set([ - 'trans', - 'independent-authority-rep', - 'indigenous', - 'continuing-custody-order', - 'distributed-learning', - 'online-learning-contact', - 'early-learning-child-care', - 'planning-officer', - 'early-learning', - 'facilities', - 'financial', - 'french', - 'international-education', - 'literacy', - 'myed-bc', - 'inclusive-education', - 'transportation', - 'superintendent', - 'chairperson', - 'secretary-treasurer', - 'executive-admin-assistant', + 'districtcontacts', 'districtmailing', 'publicschoolcontacts', - 'offshoreschoolcontacts', 'independentschoolcontacts', 'allschoolcontacts', 'allschoolmailing', @@ -101,7 +80,6 @@ function removeFieldsByCriteria(inputData, criteria) { function appendMailingAddressDetailsAndRemoveAddresses(data) { if (data && data.addresses && data.addresses.length > 0) { const physicalAddress = data.addresses.find(address => address.addressTypeCode === 'PHYSICAL'); - if (physicalAddress) { // Extract specific name-value pairs from the mailing address const { addressLine1, addressLine2, city, postal, provinceCode, countryCode } = physicalAddress; @@ -131,7 +109,6 @@ function appendMailingAddressDetailsAndRemoveAddresses(data) { data.mailingCountryCode = countryCode; // Remove the "addresses" property - } delete data.addresses; delete data.contacts; @@ -216,8 +193,8 @@ function addDistrictLabels(jsonData, districtList) { }); return reorderedObject; } - function normalizeJsonObject(sourceArray, referenceArray, matchKey, condition, includeFields) { + function normalizeJsonObject(sourceArray, referenceArray, matchKey, condition, includeFields) { return sourceArray.map((item) => { const matchingItem = referenceArray.find( (info) => info[matchKey] === item[matchKey] && (!condition || condition(info)) @@ -227,13 +204,10 @@ function addDistrictLabels(jsonData, districtList) { ...item, ...includeFields.reduce((result, field) => { result[matchKey + "_" + field] = matchingItem[field]; - - return result; }, {}), }; } - return item; }); } diff --git a/backend/src/routes/district-router.js b/backend/src/routes/district-router.js index 4d344b1c..62e9bd7e 100644 --- a/backend/src/routes/district-router.js +++ b/backend/src/routes/district-router.js @@ -7,7 +7,7 @@ const axios = require("axios"); const fs = require("fs"); const path = require("path"); const { checkToken } = require("../components/auth"); -const { listCache } = require("../components/cache"); +const { listCache} = require("../components/cache"); const {getArrayofPubliclyAvailableCodes,filterRemoveByField, filterByExpiryDate, getArrayofNonPubliclyAvailableCodes, filterByField,appendMailingAddressDetailsAndRemoveAddresses, rearrangeAndRelabelObjectProperties, addDistrictLabels, normalizeJsonObject, sortJSONByDistrictNumber, removeFieldsByCriteria, filterByPubliclyAvailableCodes} = require("../components/utils.js") //Batch Routes @@ -16,45 +16,7 @@ router.get("/all-mailing", checkToken, getAllDistrictMailing); router.get("/:id", checkToken, getDistrict); -async function removeItemsFromDistrictDataResponse(response, itemsToRemove) { - if (response && response.data) { - const newData = { ...response.data }; - if (itemsToRemove && Array.isArray(itemsToRemove)) { - itemsToRemove.forEach((item) => { - if (newData[item]) { - delete newData[item]; - } - }); - } - - response.data = newData; - } -} - -async function getDistrictCodes(req) { - if (!listCache.has("districtCodesList")) { - const url = `${config.get( - "server:instituteAPIURL" - )}/institute/district-contact-type-codes`; // Update the URL according to your API endpoint - try { - const response = await axios.get(url, { - headers: { Authorization: `Bearer ${req.accessToken}` }, - }); - const districtCodeList = response.data; - listCache.set("districtCodesList", districtCodeList); - return districtCodeList; - } catch (e) { - log.error( - "getDistrictList Error", - e.response ? e.response.status : e.message - ); - } - } else { - const districtCodeList = await listCache.get("districtCodesList"); - return districtCodeList; - } -} function getNonPublicContactTypeCodes(contactTypes) { const nonPublicContactTypeCodes = []; @@ -106,10 +68,35 @@ function removeContacts(districtDataResponse, nonPublicContactTypeCodes) { return updatedDistrictData; } +async function getDistrictCodes(req) { + if (!listCache.has("districtCodesList")) { + const url = `${config.get( + "server:instituteAPIURL" + )}/institute/district-contact-type-codes`; // Update the URL according to your API endpoint + try { + const response = await axios.get(url, { + headers: { Authorization: `Bearer ${req.accessToken}` }, + }); + const districtCodeList = response.data; + listCache.set("districtCodesList", districtCodeList); + return districtCodeList; + } catch (e) { + log.error( + "getDistrictList Error", + e.response ? e.response.status : e.message + ); + } + } else { + const districtCodeList = await listCache.get("districtCodesList"); + return districtCodeList; + } +} async function getAllDistrictContacts(req, res) { + const districtList = await listCache.get("districtlist") const contactTypeCodes= await listCache.get("codesList") const districtAddresses = await listCache.get("districtAddresses") + let currentDate = new Date().toISOString().substring(0, 19) const params = [ { @@ -194,9 +181,7 @@ async function getAllDistrictContacts(req, res) { array[index] = rearrangedElement; }); let sortedData = sortJSONByDistrictNumber(filteredData) - const validDistricts = filterRemoveByField(sortedData,"District Number", ["098","102","103"]) - - res.json(validDistricts); + res.json(sortedData); } catch (e) { log.error("getData Error", e.response ? e.response.status : e.message); @@ -330,6 +315,9 @@ async function getDistrict(req, res) { const contactTypeCodes = await getDistrictCodes(req); const districtContactCodeTypes = await listCache.get("codesList") const nonPublicContactTypeCodes = getNonPublicContactTypeCodes(contactTypeCodes); + console.log("REVIEW") + console.log(nonPublicContactTypeCodes) + const districtDataPublic = removeContacts( districtDataResponse.data, nonPublicContactTypeCodes diff --git a/backend/src/routes/download-router.js b/backend/src/routes/download-router.js index c17b3325..5eacf5c8 100644 --- a/backend/src/routes/download-router.js +++ b/backend/src/routes/download-router.js @@ -8,12 +8,10 @@ const jsonExport = require('jsonexport'); const fs = require('fs'); const path = require('path'); const {isSafeFilePath} = require("../components/utils") -const { listCache } = require("../components/cache"); - - +const { listCache, fileCache } = require("../components/cache"); const FILE_STORAGE_DIR = path.join(__dirname, '../..', 'public'); -router.get('/csv/*', checkToken, getDownload, addDistrictLabels, createCSVFile, getCSVDownload); +router.get('/csv/*', checkToken, getDownload, createCSVFile, getCSVDownload); router.get('/clear-files/:token', clearCSVFiles); async function clearCSVFiles(req, res) { @@ -32,7 +30,6 @@ async function clearCSVFiles(req, res) { // Delete each file fs.unlinkSync(filePath); }); - res.status(200).send('All files in the directory deleted successfully.'); } catch (error) { console.error(error); @@ -40,23 +37,19 @@ async function clearCSVFiles(req, res) { } } - async function createCSVFile(req,res, next){ - try { - - + try { jsonExport(req.jsonData, async function(err, csv){ if (err) return console.error(err); await writeFileAsync(filePath, csv, 'binary'); next(); }); - - } catch (error) { console.error("Error:", error); res.status(500).send("Internal server error- Write File Sync issue"); } } + async function writeFileAsync(filePath, data, encoding) { return new Promise((resolve, reject) => { fs.writeFile(filePath, data, encoding, (error) => { @@ -69,51 +62,9 @@ async function writeFileAsync(filePath, data, encoding) { }); } -async function addDistrictLabels(req, res, next) { - try { - let districtList = []; - if (listCache.has("districtlist")) { - districtList= listCache.get("districtlist"); - } else { - try { - const path = "/api/v1/institute/district/list" - const url = `${req.protocol}://${req.hostname}:8080${path}`; - - const response = await axios.get(url, { headers: { Authorization: `Bearer ${req.accessToken}` } }); - const districts = response.data; - listCache.set("districtlist", districts); - districtList = districts - - } catch (error) { - // Handle errors during the API request - throw new Error('Error fetching districts: ' + error.message); - } - } - - if (req.jsonData && Array.isArray(req.jsonData)) { - req.jsonData.forEach(dataItem => { - const district = districtList.find(item => item.districtId === dataItem.districtId); - if (district) { - dataItem.districtNumber = district.districtNumber; - dataItem.displayName = district.displayName; - } - }); - } - - next(); - } catch (error) { - // Handle errors here - console.error(error); - res.status(500).send('An error occurred.'); - } - }; - - async function getDownload(req, res,next){ - const filepath = req.query.filepath; - - if (!filepath) { + if (!filepath) {s return res.status(400).send("Missing 'filepath' parameter"); }else{ if (!isSafeFilePath(filepath)) { @@ -121,16 +72,12 @@ async function getDownload(req, res,next){ } } filePath = path.join(FILE_STORAGE_DIR, `${filepath}.csv`); - - if (fs.existsSync(filePath)) { + if(fileCache.has(filepath)){ res.setHeader('Content-Disposition', `attachment; filename="${filepath}.csv"`); return res.sendFile(filePath); }else{ try { - - const path = req.url.replace('/csv', ''); // Modify the URL path as needed - const url =`${config.get("server:backend")}/v1${path}` const response = await axios.get(url, { headers: { Authorization: `Bearer ${req.accessToken}` } }); // Attach the fetched data to the request object @@ -139,7 +86,7 @@ async function getDownload(req, res,next){ }else{ req.jsonData = response.data; } - + fileCache.set(filepath, req.jsonData) next(); // Call the next middleware } catch (error) { console.error("Error:", error); @@ -158,7 +105,6 @@ async function getCSVDownload(req, res) { return res.status(400).send("Invalid 'filepath' parameter"); } } - const filePath = path.join(FILE_STORAGE_DIR, `${filepath}.csv`); res.sendFile(filePath); } catch (error) { diff --git a/backend/src/routes/school-router.js b/backend/src/routes/school-router.js index a8157c64..accb7d93 100644 --- a/backend/src/routes/school-router.js +++ b/backend/src/routes/school-router.js @@ -53,7 +53,9 @@ async function getAllSchools(req, res) { const contactTypeCodes= await listCache.get("codesList") let params = []; + if (await !schoolCache.has("openschoollist" + schoolCategory)) { + console.log("BUILDING CACHE FOR " + "openschoollist" + schoolCategory) let currentDate = new Date().toISOString().substring(0, 19) params = [ @@ -225,6 +227,7 @@ async function getAllSchools(req, res) { ); }); } else { + console.log("USING CACHE" + " openschoollist" + schoolCategory) const openSchoolList = await schoolCache.get("openschoollist" + schoolCategory); res.json(openSchoolList); } diff --git a/frontend/package-lock.json b/frontend/package-lock.json index 6091fb2f..b114227b 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -1576,13 +1576,14 @@ "dev": true }, "node_modules/axios": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.27.2.tgz", - "integrity": "sha512-t+yRIyySRTp/wua5xEr+z1q60QmLq8ABsS5O9Me1AsE5dfKqgnCFzwiCZZ/cGNd1lq4/7akDWMxdhVlucjmnOQ==", + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.2.tgz", + "integrity": "sha512-7i24Ri4pmDRfJTR7LDBhsOTtcm+9kjX5WiY1X3wIisx6G9So3pfMkEiU7emUBe46oceVImccTEM3k6C5dbVW8A==", "dev": true, "dependencies": { - "follow-redirects": "^1.14.9", - "form-data": "^4.0.0" + "follow-redirects": "^1.15.0", + "form-data": "^4.0.0", + "proxy-from-env": "^1.1.0" } }, "node_modules/axios/node_modules/form-data": { @@ -1599,6 +1600,12 @@ "node": ">= 6" } }, + "node_modules/axios/node_modules/proxy-from-env": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", + "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==", + "dev": true + }, "node_modules/balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", @@ -2989,9 +2996,9 @@ "dev": true }, "node_modules/follow-redirects": { - "version": "1.15.2", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz", - "integrity": "sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==", + "version": "1.15.3", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.3.tgz", + "integrity": "sha512-1VzOtuEM8pC9SFU1E+8KfTjZyMztRsgEfwQl44z8A25uy13jSzTj6dyK2Df52iV0vgHCfBwLhDWevLn95w5v6Q==", "dev": true, "funding": [ { @@ -3934,9 +3941,9 @@ "dev": true }, "node_modules/joi": { - "version": "17.9.2", - "resolved": "https://registry.npmjs.org/joi/-/joi-17.9.2.tgz", - "integrity": "sha512-Itk/r+V4Dx0V3c7RLFdRh12IOjySm2/WGPMubBT92cQvRfYZhPM2W0hZlctjj72iES8jsRCwp7S/cRmWBnJ4nw==", + "version": "17.11.0", + "resolved": "https://registry.npmjs.org/joi/-/joi-17.11.0.tgz", + "integrity": "sha512-NgB+lZLNoqISVy1rZocE9PZI36bL/77ie924Ri43yEvi9GUUMPeyVIr8KdFTMUlby1p0PBYMk9spIxEUQYqrJQ==", "dev": true, "dependencies": { "@hapi/hoek": "^9.0.0", @@ -5762,9 +5769,9 @@ "dev": true }, "node_modules/start-server-and-test": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/start-server-and-test/-/start-server-and-test-2.0.0.tgz", - "integrity": "sha512-UqKLw0mJbfrsG1jcRLTUlvuRi9sjNuUiDOLI42r7R5fA9dsFoywAy9DoLXNYys9B886E4RCKb+qM1Gzu96h7DQ==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/start-server-and-test/-/start-server-and-test-2.0.3.tgz", + "integrity": "sha512-QsVObjfjFZKJE6CS6bSKNwWZCKBG6975/jKRPPGFfFh+yOQglSeGXiNWjzgQNXdphcBI9nXbyso9tPfX4YAUhg==", "dev": true, "dependencies": { "arg": "^5.0.2", @@ -5774,7 +5781,7 @@ "execa": "5.1.1", "lazy-ass": "1.6.0", "ps-tree": "1.2.0", - "wait-on": "7.0.1" + "wait-on": "7.2.0" }, "bin": { "server-test": "src/bin/start.js", @@ -5782,7 +5789,7 @@ "start-test": "src/bin/start.js" }, "engines": { - "node": ">=6" + "node": ">=16" } }, "node_modules/start-server-and-test/node_modules/execa": { @@ -6623,16 +6630,16 @@ } }, "node_modules/wait-on": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/wait-on/-/wait-on-7.0.1.tgz", - "integrity": "sha512-9AnJE9qTjRQOlTZIldAaf/da2eW0eSRSgcqq85mXQja/DW3MriHxkpODDSUEg+Gri/rKEcXUZHe+cevvYItaog==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/wait-on/-/wait-on-7.2.0.tgz", + "integrity": "sha512-wCQcHkRazgjG5XoAq9jbTMLpNIjoSlZslrJ2+N9MxDsGEv1HnFoVjOCexL0ESva7Y9cu350j+DWADdk54s4AFQ==", "dev": true, "dependencies": { - "axios": "^0.27.2", - "joi": "^17.7.0", + "axios": "^1.6.1", + "joi": "^17.11.0", "lodash": "^4.17.21", - "minimist": "^1.2.7", - "rxjs": "^7.8.0" + "minimist": "^1.2.8", + "rxjs": "^7.8.1" }, "bin": { "wait-on": "bin/wait-on" @@ -7896,13 +7903,14 @@ "dev": true }, "axios": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.27.2.tgz", - "integrity": "sha512-t+yRIyySRTp/wua5xEr+z1q60QmLq8ABsS5O9Me1AsE5dfKqgnCFzwiCZZ/cGNd1lq4/7akDWMxdhVlucjmnOQ==", + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.2.tgz", + "integrity": "sha512-7i24Ri4pmDRfJTR7LDBhsOTtcm+9kjX5WiY1X3wIisx6G9So3pfMkEiU7emUBe46oceVImccTEM3k6C5dbVW8A==", "dev": true, "requires": { - "follow-redirects": "^1.14.9", - "form-data": "^4.0.0" + "follow-redirects": "^1.15.0", + "form-data": "^4.0.0", + "proxy-from-env": "^1.1.0" }, "dependencies": { "form-data": { @@ -7915,6 +7923,12 @@ "combined-stream": "^1.0.8", "mime-types": "^2.1.12" } + }, + "proxy-from-env": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", + "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==", + "dev": true } } }, @@ -8990,9 +9004,9 @@ "dev": true }, "follow-redirects": { - "version": "1.15.2", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz", - "integrity": "sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==", + "version": "1.15.3", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.3.tgz", + "integrity": "sha512-1VzOtuEM8pC9SFU1E+8KfTjZyMztRsgEfwQl44z8A25uy13jSzTj6dyK2Df52iV0vgHCfBwLhDWevLn95w5v6Q==", "dev": true }, "for-each": { @@ -9650,9 +9664,9 @@ "dev": true }, "joi": { - "version": "17.9.2", - "resolved": "https://registry.npmjs.org/joi/-/joi-17.9.2.tgz", - "integrity": "sha512-Itk/r+V4Dx0V3c7RLFdRh12IOjySm2/WGPMubBT92cQvRfYZhPM2W0hZlctjj72iES8jsRCwp7S/cRmWBnJ4nw==", + "version": "17.11.0", + "resolved": "https://registry.npmjs.org/joi/-/joi-17.11.0.tgz", + "integrity": "sha512-NgB+lZLNoqISVy1rZocE9PZI36bL/77ie924Ri43yEvi9GUUMPeyVIr8KdFTMUlby1p0PBYMk9spIxEUQYqrJQ==", "dev": true, "requires": { "@hapi/hoek": "^9.0.0", @@ -10988,9 +11002,9 @@ "dev": true }, "start-server-and-test": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/start-server-and-test/-/start-server-and-test-2.0.0.tgz", - "integrity": "sha512-UqKLw0mJbfrsG1jcRLTUlvuRi9sjNuUiDOLI42r7R5fA9dsFoywAy9DoLXNYys9B886E4RCKb+qM1Gzu96h7DQ==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/start-server-and-test/-/start-server-and-test-2.0.3.tgz", + "integrity": "sha512-QsVObjfjFZKJE6CS6bSKNwWZCKBG6975/jKRPPGFfFh+yOQglSeGXiNWjzgQNXdphcBI9nXbyso9tPfX4YAUhg==", "dev": true, "requires": { "arg": "^5.0.2", @@ -11000,7 +11014,7 @@ "execa": "5.1.1", "lazy-ass": "1.6.0", "ps-tree": "1.2.0", - "wait-on": "7.0.1" + "wait-on": "7.2.0" }, "dependencies": { "execa": { @@ -11563,16 +11577,16 @@ } }, "wait-on": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/wait-on/-/wait-on-7.0.1.tgz", - "integrity": "sha512-9AnJE9qTjRQOlTZIldAaf/da2eW0eSRSgcqq85mXQja/DW3MriHxkpODDSUEg+Gri/rKEcXUZHe+cevvYItaog==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/wait-on/-/wait-on-7.2.0.tgz", + "integrity": "sha512-wCQcHkRazgjG5XoAq9jbTMLpNIjoSlZslrJ2+N9MxDsGEv1HnFoVjOCexL0ESva7Y9cu350j+DWADdk54s4AFQ==", "dev": true, "requires": { - "axios": "^0.27.2", - "joi": "^17.7.0", + "axios": "^1.6.1", + "joi": "^17.11.0", "lodash": "^4.17.21", - "minimist": "^1.2.7", - "rxjs": "^7.8.0" + "minimist": "^1.2.8", + "rxjs": "^7.8.1" } }, "webidl-conversions": { diff --git a/frontend/src/views/SchoolSearchView.vue b/frontend/src/views/SchoolSearchView.vue index 030c0cb4..fe630718 100644 --- a/frontend/src/views/SchoolSearchView.vue +++ b/frontend/src/views/SchoolSearchView.vue @@ -212,9 +212,6 @@ onBeforeMount(async () => { multiple > - { }); it('visits the app root url', () => { - cy.contains('h2', '100 - Abbotsford Christian School'); + cy.contains('h1', '100 - Abbotsford Christian School'); }); }); \ No newline at end of file diff --git a/tests-e2e/cypress/e2e/district.cy.ts b/tests-e2e/cypress/e2e/district.cy.ts index 7e6b597c..ecb6ee88 100644 --- a/tests-e2e/cypress/e2e/district.cy.ts +++ b/tests-e2e/cypress/e2e/district.cy.ts @@ -5,6 +5,6 @@ describe('Testing District homepage', () => { }); it('visits the app root url', () => { - cy.contains('h2', '006 - Rocky Mountain'); + cy.contains('h1', '006 - Rocky Mountain'); }); }); \ No newline at end of file diff --git a/tests-e2e/cypress/e2e/school.cy.ts b/tests-e2e/cypress/e2e/school.cy.ts index b7f2999f..53b3324b 100644 --- a/tests-e2e/cypress/e2e/school.cy.ts +++ b/tests-e2e/cypress/e2e/school.cy.ts @@ -5,6 +5,6 @@ describe('Testing School Page', () => { }); it('Confirm school title is displaying', () => { - cy.contains('h2', 'Lambrick Park Secondary - 06161064'); + cy.contains('h2', '06161064 - Lambrick Park Secondary'); }); }); \ No newline at end of file