Skip to content

Commit

Permalink
filter available entry point urls by selected domains
Browse files Browse the repository at this point in the history
  • Loading branch information
Byron Hulcher committed Feb 11, 2022
1 parent 69f223a commit b2de2bf
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,22 @@ describe('CrawlCustomSettingsFlyoutLogic', () => {
'https://swiftype.com/sitemap2.xml',
]);
});

it('filters selected entry point urls by selected domains', () => {
mount({
selectedDomainUrls: ['https://www.elastic.co', 'https://swiftype.com'],
selectedEntryPointUrls: [
'https://www.elastic.co/guide',
'https://swiftype.com/documentation',
],
});

CrawlCustomSettingsFlyoutLogic.actions.onSelectDomainUrls(['https://swiftype.com']);

expect(CrawlCustomSettingsFlyoutLogic.values.selectedEntryPointUrls).toEqual([
'https://swiftype.com/documentation',
]);
});
});

describe('onSelectEntryPointUrls', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,8 @@ export const CrawlCustomSettingsFlyoutLogic = kea<
{
showFlyout: () => [],
onSelectEntryPointUrls: (_, { entryPointUrls }) => entryPointUrls,
onSelectDomainUrls: (entryPointUrls, { domainUrls }) =>
filterSeedUrlsByDomainUrls(entryPointUrls, domainUrls),
},
],
selectedSitemapUrls: [
Expand Down

0 comments on commit b2de2bf

Please sign in to comment.