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:
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user