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.
dianshang-qianduan/tests/new-product-survey-step2.st...

16 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.join(__dirname, "../src/views/foundation/new-product-survey.vue"), "utf8");
test("实训一第二步标题与短选项采用紧凑双列布局", () => {
assert.match(source, /<section v-show="currentStep === 2" class="step-content active-step">[\s\S]*?<div class="step-card step-two-survey">/);
const stepOne = source.match(/<section v-show="currentStep === 1" class="step-content active-step">([\s\S]*?)<\/section>/)?.[1] || "";
assert.doesNotMatch(stepOne, /step-two-survey/);
assert.match(source, /\.step-two-survey\s*\{[\s\S]*?\.step-title-row\s*\{[\s\S]*?h3\s*\{[\s\S]*?font-size:\s*19px/);
assert.match(source, /\.step-two-survey\s*\{[\s\S]*?\.survey-options\s*\{[\s\S]*?grid-template-columns:\s*repeat\(2, minmax\(0, 1fr\)\)/);
assert.match(source, /@media \(max-width: 720px\)\s*\{[\s\S]*?\.step-two-survey\s*\{[\s\S]*?\.survey-options\s*\{[\s\S]*?grid-template-columns:\s*1fr/);
});