refactor: move dynamic imports to file headers
- getReferenceEngine import moved to top of cwmp_controller - Fix makeContext type in configuration_evaluation_state tests
This commit is contained in:
1 parent
31578e368f
commit
7882a49d71
2 files changed
+14
-5
No files matched your search
@@ -33,7 +33,10 @@ vi.mock('../../../../app/utils/provisioning_code.js', () => ({
|
||||
buildProvisioningCode: () => 'test-prov-code-123',
|
||||
}))
|
||||
|
||||
import { ConfigurationEvaluationState, ComplianceUpdateState } from '../../../../app/services/cwmp/configuration_evaluation_state.js'
|
||||
import {
|
||||
ConfigurationEvaluationState,
|
||||
ComplianceUpdateState,
|
||||
} from '../../../../app/services/cwmp/configuration_evaluation_state.js'
|
||||
import { Device } from '../../../../app/domain/device/device.js'
|
||||
import { DeviceId } from '../../../../app/domain/device/device_id.js'
|
||||
import { CWMPTaskQueue } from '../../../../app/services/cwmp/task_queue.js'
|
||||
@@ -46,6 +49,7 @@ function makeContext(gpnStatus: 'supported' | 'unsupported' = 'supported') {
|
||||
return {
|
||||
device,
|
||||
session: 'sess-1',
|
||||
message: undefined as { success: boolean; data: any } | undefined,
|
||||
taskQueue,
|
||||
services: { deviceAction: new DeviceActionExecutor(taskQueue) },
|
||||
}
|
||||
@@ -103,9 +107,14 @@ describe('ConfigurationEvaluationState - full happy path', () => {
|
||||
expect(r1.response).toContain('Device.DeviceInfo.')
|
||||
|
||||
// Step 2: GPN response → next GPN for Device.ManagementServer.
|
||||
context.message = { success: true, data: { ParameterList: { ParameterInfoStruct: [
|
||||
{ Name: 'Device.DeviceInfo.Manufacturer', Writable: '0' },
|
||||
] } } }
|
||||
context.message = {
|
||||
success: true,
|
||||
data: {
|
||||
ParameterList: {
|
||||
ParameterInfoStruct: [{ Name: 'Device.DeviceInfo.Manufacturer', Writable: '0' }],
|
||||
},
|
||||
},
|
||||
}
|
||||
const r2 = await state.handle(context)
|
||||
expect(r2.response).toContain('GetParameterNames')
|
||||
expect(r2.response).toContain('Device.ManagementServer.')
|
||||
|
||||
Reference in new issue
Block a user