You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
1.1 KiB
JavaScript
22 lines
1.1 KiB
JavaScript
const assert = require("node:assert/strict");
|
|
const fs = require("node:fs");
|
|
const path = require("node:path");
|
|
const test = require("node:test");
|
|
|
|
const source = fs.readFileSync(
|
|
path.resolve(__dirname, "../src/views/channel/supplier.vue"),
|
|
"utf8",
|
|
);
|
|
|
|
test("供应渠道评估第一步首次进入不预填场景权重", () => {
|
|
assert.match(source, /smallBatchWeight:\s*null,\s*largeBatchWeight:\s*null/);
|
|
assert.doesNotMatch(source, /smallBatchWeight:\s*20,\s*largeBatchWeight:\s*35/);
|
|
});
|
|
|
|
test("供应渠道评估使用接口 data 中的校验结果和学生答案", () => {
|
|
assert.match(source, /const result = \(await validateSupplierEvaluationStepOne\(buildStepOnePayload\(\)\)\)\?\.data \|\| \{\};/);
|
|
assert.match(source, /const result = \(await validateSupplierEvaluationStepTwo\(buildStepTwoPayload\(\)\)\)\?\.data \|\| \{\};/);
|
|
assert.match(source, /const result = \(await validateSupplierEvaluationStepThree\(buildStepThreePayload\(\)\)\)\?\.data \|\| \{\};/);
|
|
assert.match(source, /const answer = \(await getStudentTrainingAnswer\(TASK_KEY\)\)\?\.data \|\| \{\};/);
|
|
});
|