AI Implementation feature(900): Admin Area Challenges: List, Import/Export and Add/Edit Modal 1.00 (#41)
This commit was merged in pull request #41.
This commit is contained in:
@@ -165,6 +165,25 @@ describe('pure: challenge form helpers', () => {
|
||||
expect(out.files?.[1].stagedToken).toBe('tok');
|
||||
});
|
||||
|
||||
it('toCreateBody produces a top-level payload (no nested body envelope) for HTTP transport', () => {
|
||||
const out = toCreateBody(makeDefaults(), []);
|
||||
const requiredTopLevel = [
|
||||
'name',
|
||||
'descriptionMd',
|
||||
'categoryId',
|
||||
'difficulty',
|
||||
'initialPoints',
|
||||
'minimumPoints',
|
||||
'decaySolves',
|
||||
'flag',
|
||||
'protocol',
|
||||
];
|
||||
for (const k of requiredTopLevel) {
|
||||
expect((out as any)[k]).toBeDefined();
|
||||
expect((out as any).body).toBeUndefined();
|
||||
}
|
||||
});
|
||||
|
||||
it('buildInitialFiles hydrates a UI list from detail.files', () => {
|
||||
const list: ChallengeStagedFileUi[] = buildInitialFiles(makeDetail());
|
||||
expect(list.length).toBe(1);
|
||||
|
||||
Reference in New Issue
Block a user