AI Implementation feature(915): Admin Area Blog and Blog Page 1.01 (#60)

This commit was merged in pull request #60.
This commit is contained in:
2026-07-23 10:58:22 +00:00
parent 29b447d51f
commit 6bac67fad7
4 changed files with 76 additions and 66 deletions
+27
View File
@@ -0,0 +1,27 @@
import { readFileSync } from 'node:fs';
import { resolve } from 'node:path';
const componentPath = resolve(
__dirname,
'../../frontend/src/app/features/admin/blog/blog.component.ts',
);
const source = readFileSync(componentPath, 'utf8');
describe('AdminBlogComponent — delete confirmation disabled binding', () => {
it('binds the delete modal deleting input to actionInFlight() so Delete is enabled on open', () => {
const modalTag = extractBlogDeleteModalTag(source);
expect(modalTag).not.toBeNull();
expect(modalTag).toMatch(/\[deleting\]\s*=\s*"actionInFlight\(\)"/);
});
it('no longer derives the delete modal disabled state from the selected post', () => {
const modalTag = extractBlogDeleteModalTag(source);
expect(modalTag).not.toBeNull();
expect(modalTag).not.toMatch(/\[deleting\]\s*=\s*"deleting\(\)\s*!==\s*null"/);
});
});
function extractBlogDeleteModalTag(src: string): string | null {
const m = src.match(/<app-blog-delete-modal[\s\S]*?>/);
return m ? m[0] : null;
}