mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2026-03-12 18:43:50 +00:00
Fixed missing initial values when editing one domain redirects
This commit is contained in:
@@ -9,7 +9,12 @@ describe('<EditDomainRedirectsModal />', () => {
|
||||
let wrapper: ShallowWrapper;
|
||||
const editDomainRedirects = jest.fn().mockResolvedValue(undefined);
|
||||
const toggle = jest.fn();
|
||||
const domain = Mock.of<ShlinkDomain>({ domain: 'foo.com' });
|
||||
const domain = Mock.of<ShlinkDomain>({
|
||||
domain: 'foo.com',
|
||||
redirects: {
|
||||
baseUrlRedirect: 'baz',
|
||||
},
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
wrapper = shallow(
|
||||
@@ -51,7 +56,7 @@ describe('<EditDomainRedirectsModal />', () => {
|
||||
|
||||
wrapper.find('form').simulate('submit', { preventDefault: jest.fn() });
|
||||
expect(editDomainRedirects).toHaveBeenCalledWith('foo.com', {
|
||||
baseUrlRedirect: null,
|
||||
baseUrlRedirect: 'baz',
|
||||
regular404Redirect: null,
|
||||
invalidShortUrlRedirect: null,
|
||||
});
|
||||
@@ -75,5 +80,16 @@ describe('<EditDomainRedirectsModal />', () => {
|
||||
regular404Redirect: 'new_regular_404',
|
||||
invalidShortUrlRedirect: null,
|
||||
});
|
||||
|
||||
formGroups.at(0).simulate('change', '');
|
||||
formGroups.at(1).simulate('change', '');
|
||||
formGroups.at(2).simulate('change', '');
|
||||
|
||||
wrapper.find('form').simulate('submit', { preventDefault: jest.fn() });
|
||||
expect(editDomainRedirects).toHaveBeenCalledWith('foo.com', {
|
||||
baseUrlRedirect: null,
|
||||
regular404Redirect: null,
|
||||
invalidShortUrlRedirect: null,
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user