Commit 0df34a8b authored by pburdette's avatar pburdette

Address reviewer feedback

Beef up the specs a bit and
fix the translations file.
parent c4c38f48
......@@ -99,7 +99,7 @@ export default {
return getWeekdayNames()[this.randomWeekDayIndex];
},
parsedDailyLimit() {
return this.dailyLimit === '144' ? '5' : '60';
return this.dailyLimit ? (24 * 60) / this.dailyLimit : null;
},
scheduleDailyLimitMsg() {
return sprintf(
......
......@@ -28420,7 +28420,7 @@ msgstr ""
msgid "Scheduled a rebase of branch %{branch}."
msgstr ""
msgid "Scheduled pipelines cannot run more frequently than once per hour. A pipeline configured to run more frequently only starts after one hour has elapsed since the last time it ran."
msgid "Scheduled pipelines cannot run more frequently than once per %{limit} minutes. A pipeline configured to run more frequently only starts after %{limit} minutes have elapsed since the last time it ran."
msgstr ""
msgid "Scheduled to merge this merge request (%{strategy})."
......
......@@ -29,7 +29,6 @@ describe('Interval Pattern Input Component', () => {
const findSelectedRadio = () =>
wrapper.findAll('input[type="radio"]').wrappers.find((x) => x.element.checked);
const findIcon = () => wrapper.findComponent(GlIcon);
const findAllIcons = () => wrapper.findAllComponents(GlIcon);
const findSelectedRadioKey = () => findSelectedRadio()?.attributes('data-testid');
const selectEveryDayRadio = () => findEveryDayRadio().trigger('click');
const selectEveryWeekRadio = () => findEveryWeekRadio().trigger('click');
......@@ -212,11 +211,22 @@ describe('Interval Pattern Input Component', () => {
});
describe('Custom cron syntax quota info', () => {
it('the help text icon is only shown for the custom radio option', () => {
createWrapper({ dailyLimit: '144' });
it('the info message includes 5 minutes', () => {
createWrapper({ dailyLimit: '288' });
expect(findIcon().exists()).toBe(true);
expect(findAllIcons().length).toBe(1);
expect(findIcon().attributes('title')).toContain('5 minutes');
});
it('the info message includes 60 minutes', () => {
createWrapper({ dailyLimit: '24' });
expect(findIcon().attributes('title')).toContain('60 minutes');
});
it('the info message icon is not shown when there is no daily limit', () => {
createWrapper();
expect(findIcon().exists()).toBe(false);
});
});
});
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment