65 lines
2.1 KiB
JavaScript
65 lines
2.1 KiB
JavaScript
import { describe, it, expect } from 'bun:test';
|
|
import { existsSync, readFileSync } from 'fs';
|
|
import { join } from 'path';
|
|
|
|
const publicDir = join(process.cwd(), 'public');
|
|
const cssDir = join(publicDir, 'css');
|
|
|
|
describe('CSS Extraction', () => {
|
|
describe('CSS Files Exist', () => {
|
|
it('should have base.css file', () => {
|
|
const cssPath = join(cssDir, 'base.css');
|
|
expect(existsSync(cssPath)).toBe(true);
|
|
});
|
|
|
|
it('should have components.css file', () => {
|
|
const cssPath = join(cssDir, 'components.css');
|
|
expect(existsSync(cssPath)).toBe(true);
|
|
});
|
|
|
|
it('should have home page CSS file', () => {
|
|
const cssPath = join(cssDir, 'pages', 'home.css');
|
|
expect(existsSync(cssPath)).toBe(true);
|
|
});
|
|
|
|
it('should have property detail page CSS file', () => {
|
|
const cssPath = join(cssDir, 'pages', 'property.css');
|
|
expect(existsSync(cssPath)).toBe(true);
|
|
});
|
|
|
|
it('should have admin panel CSS file', () => {
|
|
const cssPath = join(cssDir, 'pages', 'admin.css');
|
|
expect(existsSync(cssPath)).toBe(true);
|
|
});
|
|
});
|
|
|
|
describe('HTML Links to CSS', () => {
|
|
it('should link base.css in index.html', () => {
|
|
const html = readFileSync(join(publicDir, 'index.html'), 'utf-8');
|
|
expect(html).toContain('href="css/base.css"');
|
|
});
|
|
|
|
it('should link base.css in property.html', () => {
|
|
const html = readFileSync(join(publicDir, 'property.html'), 'utf-8');
|
|
expect(html).toContain('href="css/base.css"');
|
|
});
|
|
|
|
it('should link base.css in admin.html', () => {
|
|
const html = readFileSync(join(publicDir, 'admin.html'), 'utf-8');
|
|
expect(html).toContain('href="css/base.css"');
|
|
});
|
|
});
|
|
|
|
describe('CSS Content Validation', () => {
|
|
it('should contain CSS variables for theme colors', () => {
|
|
const css = readFileSync(join(cssDir, 'variables.css'), 'utf-8');
|
|
expect(css).toContain('--primary:');
|
|
expect(css).toContain('--secondary:');
|
|
});
|
|
|
|
it('should contain responsive grid classes', () => {
|
|
const homeCss = readFileSync(join(cssDir, 'pages', 'home.css'), 'utf-8');
|
|
expect(homeCss).toContain('@media');
|
|
});
|
|
});
|
|
}); |