Skip to content

Commit

Permalink
feat: redirects to content client
Browse files Browse the repository at this point in the history
  • Loading branch information
alinarublea committed Sep 17, 2024
1 parent 492806d commit 861f54e
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,16 @@ describe('ContentClient', () => {
const client = ContentClient.createFrom(context, siteConfigGoogleDrive);
await expect(client.updateRedirects(newRedirects)).to.be.rejectedWith('Redirect cycle detected');
});
it('does not call rawClient when all redirects are duplicates', async () => {
const newRedirects = [
{ from: '/test-A', to: '/test-B' },
{ from: '/test-C', to: '/test-D' },
];
ContentClient = await createContentClientForRedirects(existingRedirects);
const client = ContentClient.createFrom(context, siteConfigGoogleDrive);
await client.updateRedirects(newRedirects);
await expect(client.rawClient.appendRedirects).to.not.have.been.called;
});
it('does not call rawClient when there are no valid redirects', async () => {
const newRedirects = [
{ from: '/test-D', to: '/test-A' },
Expand Down

0 comments on commit 861f54e

Please sign in to comment.