Fixed links and some form styles

This commit is contained in:
Alejandro Celaya
2022-03-05 14:04:01 +01:00
parent f4fa1582a7
commit ec403d7b1f
10 changed files with 38 additions and 25 deletions

View File

@@ -3,6 +3,7 @@ import { Mock } from 'ts-mockery';
import { DropdownItem } from 'reactstrap';
import { ShortUrlCreationSettings as ShortUrlsSettings, Settings } from '../../src/settings/reducers/settings';
import { ShortUrlCreationSettings } from '../../src/settings/ShortUrlCreationSettings';
import { FormText } from '../../src/utils/FormText';
import ToggleSwitch from '../../src/utils/ToggleSwitch';
import { DropdownBtn } from '../../src/utils/DropdownBtn';
@@ -51,7 +52,7 @@ describe('<ShortUrlCreationSettings />', () => {
[ undefined, 'Validate URL checkbox will be unchecked' ],
])('shows expected helper text for URL validation', (shortUrlCreation, expectedText) => {
const wrapper = createWrapper(shortUrlCreation);
const validateUrlText = wrapper.find('.form-text').first();
const validateUrlText = wrapper.find(FormText).first();
expect(validateUrlText.text()).toContain(expectedText);
});
@@ -62,7 +63,7 @@ describe('<ShortUrlCreationSettings />', () => {
[{}, 'Forward query params on redirect checkbox will be checked' ],
])('shows expected helper text for query forwarding', (shortUrlCreation, expectedText) => {
const wrapper = createWrapper({ validateUrls: true, ...shortUrlCreation });
const forwardQueryText = wrapper.find('.form-text').at(1);
const forwardQueryText = wrapper.find(FormText).at(1);
expect(forwardQueryText.text()).toContain(expectedText);
});
@@ -77,7 +78,7 @@ describe('<ShortUrlCreationSettings />', () => {
[ undefined, 'Suggest tags starting with input', 'starting with' ],
])('shows expected texts for tags suggestions', (shortUrlCreation, expectedText, expectedHint) => {
const wrapper = createWrapper(shortUrlCreation);
const hintText = wrapper.find('.form-text').last();
const hintText = wrapper.find(FormText).last();
const dropdown = wrapper.find(DropdownBtn);
expect(dropdown.prop('text')).toEqual(expectedText);