Rocky_Mountain_Vending/.pnpm-store/v10/files/c2/808b79b00a62d2a681930803d27d0eb7a0002e3808f9b32cd899e83a7c87b7619f5ba3f7fe81e4065a9e95a89c4d7d536771664f5027116f7181b2fdc46242
DMleadgen 46d973904b
Initial commit: Rocky Mountain Vending website
Next.js website for Rocky Mountain Vending company featuring:
- Product catalog with Stripe integration
- Service areas and parts pages
- Admin dashboard with Clerk authentication
- SEO optimized pages with JSON-LD structured data

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 16:22:15 -07:00

37 lines
1.3 KiB
Text

const _ = require('lodash')
const {entities, getRootDomain, getEntity} = require('./index.js')
describe('Entities', () => {
it('should not have duplicate names', () => {
for (let i = 0; i < entities.length; i++) {
for (let j = i + 1; j < entities.length; j++) {
const nameA = entities[i].name.replace(/\s+/, '').toLowerCase()
const nameB = entities[j].name.replace(/\s+/, '').toLowerCase()
if (nameA !== nameB) continue
expect(entities[i]).toBe(entities[j])
}
}
})
it('should not have non-supported wilcards', () => {
for (const entity of entities) {
for (const domain of entity.domains) {
// Wildcards must be like `*.blah.com`
// Wildcards cannot be `*blah.com` or `blah*.com`
expect(domain).toEqual(expect.not.stringMatching(/\w\*/))
expect(domain).toEqual(expect.not.stringMatching(/\*\w/))
}
}
})
it('should not have commas within a domain', () => {
for (const entity of entities) {
for (const domain of entity.domains) {
// A domain can be `*.maxymiser.net` or `maxymiser.hs.llnwd.net`
// A domain can't be `*.maxymiser.net, maxymiser.hs.llnwd.net`
expect(domain).toEqual(expect.not.stringContaining(','))
}
}
})
})