mirror of
https://github.com/Zakkaus/doona.git
synced 2026-12-05 16:02:03 +00:00
fix(policies): stop blaming TCP support when Test all is unavailable
canProbe is false when the backend offers no TCP probe, when its probe limits are too small for the group, when the group has no members, or when the group takes no TCP probe. The disabled button's tip and the untested help both said the group does not support TCP probes, which is wrong in the first three cases. Both now say only that Test all is not available for this group, in all three languages.
This commit is contained in:
1 parent
a66663e819
commit
417c47fb28
6 files changed
+31
-13
No files matched your search
@@ -135,3 +135,20 @@ test('a group check URL is edited in its dialog, refused inline when unsafe', as
|
||||
]);
|
||||
expect(patches[0].headers()['if-match']).toBe('"40"');
|
||||
});
|
||||
|
||||
test('a disabled Test all does not blame TCP support when the probe limits rule it out', async ({page}) => {
|
||||
const {capabilities} = await mockBackend(page);
|
||||
// The group takes TCP probes; the backend's job limit is what rules Test all out.
|
||||
capabilities.resources.probes.limits!.max_members_per_job = 0;
|
||||
await page.goto('/#/policies');
|
||||
const probe = page.getByRole('region', {name: 'resilient', exact: true}).getByRole('button', {name: 'Test all', exact: true});
|
||||
await expect(probe).toBeDisabled();
|
||||
// The disabled button's wrapper is its focus stop; reaching it by keyboard opens the tip at once, where a hover
|
||||
// waits out the delay and closes if the card moves under the pointer.
|
||||
const stop = probe.locator('xpath=..');
|
||||
await stop.focus();
|
||||
await page.keyboard.press('Shift+Tab');
|
||||
await page.keyboard.press('Tab');
|
||||
await expect(stop).toBeFocused();
|
||||
await expect(page.getByRole('tooltip')).toHaveText('Test all is not available for this group');
|
||||
});
|
||||
@@ -88,7 +88,7 @@ export const messages = defineMessages({
|
||||
'policy.members': '{n} 個成員',
|
||||
'policy.membersDown': '{n} 個成員,{down} 個無法使用',
|
||||
'policy.loading': '正在載入 {id}…',
|
||||
'policy.noProbe': '此群組不支援 TCP 探測',
|
||||
'policy.noProbe': '此群組無法使用「測試全部」',
|
||||
'policy.probing': '測試中…',
|
||||
'policy.probeAll': '測試全部',
|
||||
'policy.healthy': '{n} 個可用',
|
||||
@@ -96,7 +96,7 @@ export const messages = defineMessages({
|
||||
'policy.untested': '{n} 個未測試',
|
||||
'policy.untestedHelp': '這些成員的狀態尚未確定。',
|
||||
'policy.untestedProbe': '可使用「測試全部」重新測試。',
|
||||
'policy.untestedNoProbe': '此群組不支援 TCP 探測。',
|
||||
'policy.untestedNoProbe': '此群組無法使用「測試全部」。',
|
||||
'policy.network': '為 {name} 選擇網路',
|
||||
'policy.both': '兩者',
|
||||
'policy.updated': '{name} 組態已寫入並重載',
|
||||
@@ -234,7 +234,7 @@ export const messages = defineMessages({
|
||||
'policy.members': '{n} 个成员',
|
||||
'policy.membersDown': '{n} 个成员,{down} 个不可用',
|
||||
'policy.loading': '正在加载 {id}…',
|
||||
'policy.noProbe': '此组不支持 TCP 探测',
|
||||
'policy.noProbe': '此组无法使用“测试全部”',
|
||||
'policy.probing': '测试中…',
|
||||
'policy.probeAll': '测试全部',
|
||||
'policy.healthy': '{n} 个可用',
|
||||
@@ -242,7 +242,7 @@ export const messages = defineMessages({
|
||||
'policy.untested': '{n} 个未测试',
|
||||
'policy.untestedHelp': '这些成员的状态尚未确定。',
|
||||
'policy.untestedProbe': '可使用“测试全部”重新测试。',
|
||||
'policy.untestedNoProbe': '此组不支持 TCP 探测。',
|
||||
'policy.untestedNoProbe': '此组无法使用“测试全部”。',
|
||||
'policy.network': '为 {name} 选择网络',
|
||||
'policy.both': '两者',
|
||||
'policy.updated': '{name} 配置已写入并重载',
|
||||
@@ -384,7 +384,7 @@ export const messages = defineMessages({
|
||||
},
|
||||
'policy.membersDown': {one: '{n} member, {down} unavailable', other: '{n} members, {down} unavailable'},
|
||||
'policy.loading': 'Loading {id}…',
|
||||
'policy.noProbe': 'This group does not support TCP probes',
|
||||
'policy.noProbe': 'Test all is not available for this group',
|
||||
'policy.probing': 'Testing…',
|
||||
'policy.probeAll': 'Test all',
|
||||
'policy.healthy': '{n} available',
|
||||
@@ -392,7 +392,7 @@ export const messages = defineMessages({
|
||||
'policy.untested': '{n} untested',
|
||||
'policy.untestedHelp': 'The state of these members is not known yet.',
|
||||
'policy.untestedProbe': 'Use Test all to test them again.',
|
||||
'policy.untestedNoProbe': 'This group does not support TCP probes.',
|
||||
'policy.untestedNoProbe': 'Test all is not available for this group.',
|
||||
'policy.network': 'Select network for {name}',
|
||||
'policy.both': 'Both',
|
||||
'policy.updated': 'Configuration for {name} written and reloaded',
|
||||
|
||||
@@ -192,7 +192,8 @@ export function nodeGridView(
|
||||
};
|
||||
}
|
||||
|
||||
// Why members are untested, and whether Test all can settle it: a group that takes no probe cannot.
|
||||
// Why members are untested, and whether Test all can settle it: it cannot when the backend offers no TCP probe within
|
||||
// its limits, or the group has no members or takes no TCP probe.
|
||||
export function untestedHelp(untested: string | null, canProbe: boolean, t: Translator): Help | null {
|
||||
return untested ? {title: untested, text: [t('policy.untestedHelp'), t(canProbe ? 'policy.untestedProbe' : 'policy.untestedNoProbe')]} : null;
|
||||
}
|
||||
@@ -728,7 +728,7 @@ export const messages = {
|
||||
'policy.members': {one: '{n} member', other: '{n} members'},
|
||||
'policy.membersDown': {one: '{n} member, {down} unavailable', other: '{n} members, {down} unavailable'},
|
||||
'policy.loading': 'Loading {id}…',
|
||||
'policy.noProbe': 'This group does not support TCP probes',
|
||||
'policy.noProbe': 'Test all is not available for this group',
|
||||
'policy.probing': 'Testing…',
|
||||
'policy.probeAll': 'Test all',
|
||||
'policy.healthy': '{n} available',
|
||||
@@ -736,7 +736,7 @@ export const messages = {
|
||||
'policy.untested': '{n} untested',
|
||||
'policy.untestedHelp': 'The state of these members is not known yet.',
|
||||
'policy.untestedProbe': 'Use Test all to test them again.',
|
||||
'policy.untestedNoProbe': 'This group does not support TCP probes.',
|
||||
'policy.untestedNoProbe': 'Test all is not available for this group.',
|
||||
'policy.network': 'Select network for {name}',
|
||||
'policy.both': 'Both',
|
||||
'policy.updated': 'Configuration for {name} written and reloaded',
|
||||
|
||||
@@ -704,7 +704,7 @@ export const messages = {
|
||||
'policy.members': '{n} 个成员',
|
||||
'policy.membersDown': '{n} 个成员,{down} 个不可用',
|
||||
'policy.loading': '正在加载 {id}…',
|
||||
'policy.noProbe': '此组不支持 TCP 探测',
|
||||
'policy.noProbe': '此组无法使用“测试全部”',
|
||||
'policy.probing': '测试中…',
|
||||
'policy.probeAll': '测试全部',
|
||||
'policy.healthy': '{n} 个可用',
|
||||
@@ -712,7 +712,7 @@ export const messages = {
|
||||
'policy.untested': '{n} 个未测试',
|
||||
'policy.untestedHelp': '这些成员的状态尚未确定。',
|
||||
'policy.untestedProbe': '可使用“测试全部”重新测试。',
|
||||
'policy.untestedNoProbe': '此组不支持 TCP 探测。',
|
||||
'policy.untestedNoProbe': '此组无法使用“测试全部”。',
|
||||
'policy.network': '为 {name} 选择网络',
|
||||
'policy.both': '两者',
|
||||
'policy.updated': '{name} 配置已写入并重载',
|
||||
|
||||
@@ -703,7 +703,7 @@ export const messages = {
|
||||
'policy.members': '{n} 個成員',
|
||||
'policy.membersDown': '{n} 個成員,{down} 個無法使用',
|
||||
'policy.loading': '正在載入 {id}…',
|
||||
'policy.noProbe': '此群組不支援 TCP 探測',
|
||||
'policy.noProbe': '此群組無法使用「測試全部」',
|
||||
'policy.probing': '測試中…',
|
||||
'policy.probeAll': '測試全部',
|
||||
'policy.healthy': '{n} 個可用',
|
||||
@@ -711,7 +711,7 @@ export const messages = {
|
||||
'policy.untested': '{n} 個未測試',
|
||||
'policy.untestedHelp': '這些成員的狀態尚未確定。',
|
||||
'policy.untestedProbe': '可使用「測試全部」重新測試。',
|
||||
'policy.untestedNoProbe': '此群組不支援 TCP 探測。',
|
||||
'policy.untestedNoProbe': '此群組無法使用「測試全部」。',
|
||||
'policy.network': '為 {name} 選擇網路',
|
||||
'policy.both': '兩者',
|
||||
'policy.updated': '{name} 組態已寫入並重載',
|
||||
|
||||
Reference in new issue
Block a user