Fix profile server selection activation state
This commit is contained in:
@@ -27,7 +27,8 @@ test('server picker has one public feature owner without legacy shims', () => {
|
||||
assert.equal((overview.match(/<ServerPicker/g) || []).length, 1);
|
||||
assert.doesNotMatch(picker, /from ['"][^'"]*\/api\/|\bapi\./);
|
||||
assert.match(overview, /const selectedServerId = desiredProfile\?\.desiredServerId \|\| ''/);
|
||||
assert.match(overview, /function selectServer\(profile: ProfileSnapshot, serverId: string\)[\s\S]*onApply\(profile\.id, serverId\)[\s\S]*onSelectProfileServer\(profile\.id, serverId\)/);
|
||||
assert.match(overview, /function selectServer\(profile: ProfileSnapshot, serverId: string\)[\s\S]*if \(connected && !gatewayDirect\)[\s\S]*onApply\(profile\.id, serverId\)[\s\S]*onSelectProfileServer\(profile\.id, serverId\)/);
|
||||
assert.match(overview, /selectedServerId=\{pickerState\.selectedServerId\}/);
|
||||
});
|
||||
|
||||
const fixtures = (count) => Array.from({ length: count }, (_, index) => ({
|
||||
|
||||
@@ -37,26 +37,26 @@ const expectedImports = [
|
||||
const sha256 = (value) => crypto.createHash('sha256').update(value).digest('hex');
|
||||
const acceptedLedger = {
|
||||
counts: {
|
||||
cascadeEdges: 752,
|
||||
cascadeEdges: 749,
|
||||
customProperties: 103,
|
||||
declarations: 3202,
|
||||
declarations: 3200,
|
||||
important: 0,
|
||||
keyframes: 56,
|
||||
media: 13,
|
||||
rules: 917,
|
||||
variableReferences: 794,
|
||||
variableReferences: 791,
|
||||
},
|
||||
hashes: {
|
||||
cascadeEdges: '5c09bfa1ab715bdd522969d017f4ff974e2a8fc391305e68943e39612245f815',
|
||||
cascadeEdges: 'a47dbf5212045c865de7a41d420e78df8b992a6ec1b06fb18a8d459cd480f0ae',
|
||||
customProperties: 'fc8401b40b8d2cc8a1fc1716360ba8e5baccb694cdabde68427d3c92c04a84d4',
|
||||
declarations: '0cacb55296aad8af6790036c75831f7a87429ec055481d9eb71d564e4d8a828c',
|
||||
declarations: '198ccda82654a42a5ba3f452fed7a6e9a0ef1c0ff13d243eceb2c1965b4a91cd',
|
||||
duplicateKeyframes: '4f53cda18c2baa0c0354bb5f9a3ecbe5ed12ab4d8e11ba873c2f11161202b945',
|
||||
duplicateSelectors: '419962e669cbfdf5c8186318cb26688477fc0199cae98df8e1cd9bf5cddd76c2',
|
||||
duplicateSelectors: '257eff4727dab9ce25f4e1f9320e89bf2270eb29feae921b96601f103ad7f036',
|
||||
keyframes: 'fb859c4d0d1bfd2f5a18904e30a5f79c6ce6931d74fe88cbd506fb28c334b7ac',
|
||||
ruleDeclarationSequences: 'b2b02e78df98c48405a5243bb07e0cd6dfcfac83f7fea7847e82041741a56e14',
|
||||
selectors: 'e4c3dc48d8998e9fc76a0a3eb147fe6366ebfc93e22ba9ebe77f08f1fe84de2f',
|
||||
variableReferences: '252702ab07ce1c790d77a60f8e674cb3b55f7ffe6e52329a50b69e5306442f1f',
|
||||
witnesses: 'f51f070cc2c7dba0f8d08518cdeee49eaf176aac82e3571cdd8498315ba8db83',
|
||||
ruleDeclarationSequences: 'e4d989c091659ad82e79de7281c2b94b7b76d5f032f2a814e630275b7f7b7c4b',
|
||||
selectors: 'd1948bb0fb3899264af80cd1f86b9c8e9cdcf1a4473ef77a0dec4ffad10d1f8d',
|
||||
variableReferences: '00551e699e5530d624d364db9e546c0ffc05d7c79d04abc42930a98be874b3bf',
|
||||
witnesses: '07f462edf94d90909902283f5af130f290c957c3f10ddaa5a2b2339eb64d468a',
|
||||
},
|
||||
};
|
||||
|
||||
@@ -209,7 +209,7 @@ test('client typography uses the shared semantic scale outside the token owner',
|
||||
|
||||
test('accepted stylesheet has pinned declaration, selector, keyframe, variable, and cascade ledgers', () => {
|
||||
const witnesses = readStyleWitnesses(root);
|
||||
assert.equal(witnesses.length, 730);
|
||||
assert.equal(witnesses.length, 729);
|
||||
assert.equal(witnesses.filter((witness) => witness.unknown || witness.ancestorUnknown).length, 0);
|
||||
const ledger = createStyleLedger(readStyleSource(root), { witnesses });
|
||||
assert.deepEqual(ledger.counts, acceptedLedger.counts);
|
||||
@@ -405,8 +405,8 @@ test('main owns one public stylesheet and the regrouped production CSS is determ
|
||||
assert.equal((main.match(/import ['"][^'"]+\.css['"]/g) || []).length, 1);
|
||||
|
||||
const assets = fs.readdirSync(path.join(root, 'dist/assets')).filter((file) => file.endsWith('.css'));
|
||||
assert.deepEqual(assets, ['index-dA_YmbDB.css']);
|
||||
assert.deepEqual(assets, ['index-SYp2glgN.css']);
|
||||
const built = fs.readFileSync(path.join(root, 'dist/assets', assets[0]));
|
||||
assert.equal(built.byteLength, 123538);
|
||||
assert.equal(sha256(built), '7c506bdd5d073515239a4d779f6f5365a07ef245c057772ba6a343b6d90838e7');
|
||||
assert.equal(built.byteLength, 123402);
|
||||
assert.equal(sha256(built), '8050f9e31292529b97d716d38140da72364c26368af92dd5b3a8d56c9fe752ad');
|
||||
});
|
||||
|
||||
@@ -111,7 +111,10 @@ test('profiles render as flat accordion groups with scoped controls', () => {
|
||||
assert.match(feature, /feature\.operations\.profileRefresh\?\.target === profile\.id/);
|
||||
assert.match(feature, /\{visibleServer && <button[\s\S]*client-profile-selected-server[\s\S]*aria-expanded=\{expanded\}/);
|
||||
assert.match(feature, /anchorServerId: visibleServer\?\.id \|\| ''/);
|
||||
assert.match(feature, /const visibleServerId = applied \? feature\.selection\.appliedServerId : profile\.desiredServerId/);
|
||||
assert.match(feature, /const visibleServerId = applied[\s\S]*feature\.selection\.appliedServerId[\s\S]*desired \? profile\.desiredServerId : ''/);
|
||||
assert.match(feature, /selectedServerId: visibleServerId/);
|
||||
assert.doesNotMatch(feature, /Сделать активной|client-profile-activate|onActivate/);
|
||||
assert.doesNotMatch(page, /onActivateProfile/);
|
||||
assert.match(feature, /const desired = !feature\.connected[\s\S]*&& !feature\.gatewayDirect/);
|
||||
assert.match(feature, /const profileDomain = subscriptionDomain\(profile\.subscription\.host\)/);
|
||||
assert.match(feature, /const profileDetails = `Серверов: \$\{profile\.servers\.length\}/);
|
||||
@@ -122,6 +125,7 @@ test('profiles render as flat accordion groups with scoped controls', () => {
|
||||
assert.match(styles, /@media \(prefers-reduced-motion: reduce\)[\s\S]*\.client-profile-body \*/);
|
||||
assert.match(styles, /\.client-profile-refresh\.is-refreshing/);
|
||||
assert.match(styles, /\.client-profile-refresh,[\s\S]*\.client-profile-delete\s*\{[\s\S]*width:\s*36px;[\s\S]*height:\s*36px;[\s\S]*display:\s*grid;[\s\S]*place-items:\s*center/);
|
||||
assert.match(styles, /\.client-profile-activate\s*\{[\s\S]*font:\s*var\(--type-micro\)/);
|
||||
assert.match(styles, /\.client-profile-refresh\s*\{[\s\S]*grid-column:\s*3/);
|
||||
assert.match(styles, /\.client-profile-delete\s*\{[\s\S]*grid-column:\s*4/);
|
||||
assert.doesNotMatch(feature, /client-subscription-card|role="tab"/);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user