Skip to content

Commit

Permalink
chore: pr review
Browse files Browse the repository at this point in the history
  • Loading branch information
solaris007 committed Nov 19, 2024
1 parent 3b46782 commit 38d79cf
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions packages/spacecat-shared-data-access/test/it/v2/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ const generateSampleData = async (dataAccess, siteId) => {
const type = i % 2 === 0 ? 'broken-backlinks' : 'broken-internal-links';
const status = i % 2 === 0 ? 'NEW' : 'IN_PROGRESS';
const data = type === 'broken-backlinks'
? { brokenLinks: [`https://another-example-${i}.com`] }
: { brokenInternalLinks: [`https://another-example-${i}.com`] };
? { brokenLinks: [`foo-${i}`] }
: { brokenInternalLinks: [`bar-${i}`] };

// eslint-disable-next-line no-await-in-loop
const opportunity = await Opportunity.create({
Expand All @@ -70,7 +70,7 @@ const generateSampleData = async (dataAccess, siteId) => {
opportunityId: opportunity.getId(),
title: `Suggestion ${j} for Opportunity ${i}`,
description: `Description for Suggestion ${j} of Opportunity ${i}`,
data: { suggestionData: `https://suggestion-${j}.com` },
data: { foo: `bar-${j}` },
type: 'CODE_CHANGE',
rank: j,
status: 'NEW',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ describe('OpportunityCollection', () => {
opportunityId: 'op12345',
siteId: 'site67890',
data: {
title: 'Test Opportunity',
description: 'This is a test opportunity.',
foo: 'bar',
bing: 'batz',
},
};
const mockOpportunityModel = new Opportunity(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ describe('SuggestionCollection', () => {
expect(results[0].record).to.deep.include(mockSuggestionModel.record);
});

it('returns an empty array if no opportunities exist for the given site ID', async () => {
it('returns an empty array if no suggestions exist for the given opportunity ID', async () => {
mockElectroService.entities.suggestion.query.byOpportunityId.returns(
{ go: () => Promise.resolve([]) },
);
Expand All @@ -104,7 +104,7 @@ describe('SuggestionCollection', () => {
expect(results).to.be.an('array').that.is.empty;
});

it('throws an error if siteId is not provided', async () => {
it('throws an error if opportunityId is not provided', async () => {
await expect(suggestionCollectionInstance.allByOpportunityId(''))
.to.be.rejectedWith('OpportunityId is required');
});
Expand Down

0 comments on commit 38d79cf

Please sign in to comment.