feat: add A-Copilot settings and refine AI configuration layout

This commit is contained in:
2026-10-19 14:15:23 +09:00
parent cef1172fc1
commit 0b803a27ee
6 changed files with 89 additions and 57 deletions
+12 -9
View File
@@ -24,7 +24,6 @@ const props = {
session: { accessToken: 'test-token', user: { id: 'teacher' } },
selectedCourseId: 'course-a',
courses: [{ id: 'course-a', title: 'A' }, { id: 'course-b', title: 'B' }],
onSelectCourse() {},
};
test('settings remounts the credential draft when course or session changes', () => {
@@ -35,21 +34,20 @@ test('settings remounts the credential draft when course or session changes', ()
assert.notEqual(initial.key, form({ ...props, session: { ...props.session, accessToken: 'new-token' } }).key);
});
test('settings offers the global course selection and no credential form without a course', () => {
const selected = [];
const tree = SettingsPage({ ...props, onSelectCourse: id => selected.push(id) });
test('settings is width-constrained and centered without a duplicate course selector', () => {
const tree = SettingsPage(props);
assert.match(tree.props.className, /mx-auto.*w-full.*max-w-\[920px\]/);
const header = React.Children.toArray(tree.props.children)[0];
const select = elements(header.props.action, node => node.type === 'select')[0];
assert.equal(select.props.value, 'course-a');
select.props.onChange({ target: { value: 'course-b' } });
assert.deepEqual(selected, ['course-b']);
assert.equal(header.props.action, undefined);
assert.equal(elements(tree, node => node.type === 'select').length, 0);
assert.equal(elements(SettingsPage({ ...props, selectedCourseId: '', courses: [] }), node => node.type === CourseAiSettings).length, 0);
});
test('curriculum no longer loads AI settings or offers an agent tab', () => {
const curriculum = read('pages/curriculum/CurriculumPage.tsx');
assert.doesNotMatch(curriculum, /getCourseAiSetting|updateCourseAiSetting|handleSaveAiSetting|setActiveTab\('ai'\)/);
assert.match(read('App.tsx'), /<SettingsPage session=\{session\} selectedCourseId=\{selectedCourseId\} courses=\{courses\} onSelectCourse=\{onSelectCourse\}/);
assert.match(read('App.tsx'), /<SettingsPage session=\{session\} selectedCourseId=\{selectedCourseId\} courses=\{courses\} \/>/);
assert.match(read('App.tsx'), /<InstructorLayout[\s\S]*?onSelectCourse=\{handleSelectCourse\}/);
});
test('analytics is hidden from the menu without deleting its existing route', () => {
@@ -59,3 +57,8 @@ test('analytics is hidden from the menu without deleting its existing route', ()
assert.equal(routes.isAppRoute('analytics'), true);
assert.equal(routes.getRouteFromPathname('/lms-adm/analytics'), 'analytics');
});
test('settings has a general-purpose noun phrase rather than an AI-only sentence', () => {
const { pageMeta } = compile(read('pageMeta.ts'));
assert.equal(pageMeta.settings.description, '강좌 및 서비스 환경 설정');
});