refactor(linkedin-studio): M0-10 — content-filter recognizes external drafts (after negatives, before infraDirs)

This commit is contained in:
Kjell Tore Guttormsen 2026-06-18 11:50:04 +02:00
commit 2e2a8c5d60
2 changed files with 40 additions and 1 deletions

View file

@ -85,3 +85,35 @@ describe('isLinkedInContent — code/config/template/meta files (negative)', ()
assert.equal(isLinkedInContent(undefined), false);
});
});
// M0-10: after drafts relocate to the external data root, the gate must still
// fire on them. `.claude` is an infraDir, so a naive check rejects any /.claude/
// path — the external-drafts positive must short-circuit BEFORE that negative,
// while the state file (.local.md) and REMEMBER.md stay excluded.
describe('isLinkedInContent — external data-root drafts (M0-10)', () => {
const H = '/Users/test';
test('fires on a relocated draft under ~/.claude/linkedin-studio/drafts/', () => {
assert.equal(isLinkedInContent(`${H}/.claude/linkedin-studio/drafts/2026-06-20-post.md`), true);
});
test('fires on a relocated carousel slide under the external drafts dir', () => {
assert.equal(isLinkedInContent(`${H}/.claude/linkedin-studio/drafts/carousel-x/slide-1.png`), true);
});
test('does NOT fire on the external state file (.local.md)', () => {
assert.equal(isLinkedInContent(`${H}/.claude/linkedin-studio.local.md`), false);
});
test('does NOT fire on the external REMEMBER.md', () => {
assert.equal(isLinkedInContent(`${H}/.claude/linkedin-studio/REMEMBER.md`), false);
});
test('does NOT fire on ~/.claude/settings.json', () => {
assert.equal(isLinkedInContent(`${H}/.claude/settings.json`), false);
});
test('still fires on in-plugin assets/drafts/ (migration-window back-compat)', () => {
assert.equal(isLinkedInContent('assets/drafts/2026-06-20-post.md'), true);
});
});