Skip to content

Commit

Permalink
fix: fix all tests and coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
alinarublea committed Jun 25, 2024
2 parents 40f3c83 + 6bed341 commit f89e872
Show file tree
Hide file tree
Showing 15 changed files with 2,933 additions and 2,900 deletions.
5,760 changes: 2,880 additions & 2,880 deletions package-lock.json

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
"@semantic-release/changelog": "6.0.3",
"@semantic-release/git": "10.0.1",
"@semantic-release/npm": "12.0.1",
"@typescript-eslint/eslint-plugin": "7.13.0",
"@typescript-eslint/parser": "7.13.0",
"@typescript-eslint/eslint-plugin": "7.13.1",
"@typescript-eslint/parser": "7.13.1",
"ajv": "8.16.0",
"c8": "10.1.2",
"eslint": "8.57.0",
Expand All @@ -45,7 +45,7 @@
"nock": "13.5.4",
"semantic-release": "24.0.0",
"semantic-release-monorepo": "8.0.2",
"typescript": "5.4.5"
"typescript": "5.5.2"
},
"lint-staged": {
"*.js": "eslint"
Expand Down
2 changes: 1 addition & 1 deletion packages/spacecat-shared-ahrefs-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,6 @@
"nock": "13.5.4",
"sinon": "18.0.0",
"sinon-chai": "3.7.0",
"typescript": "5.4.5"
"typescript": "5.5.2"
}
}
12 changes: 12 additions & 0 deletions packages/spacecat-shared-data-access/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
# [@adobe/spacecat-shared-data-access-v1.33.0](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-data-access-v1.32.0...@adobe/spacecat-shared-data-access-v1.33.0) (2024-06-21)


### Bug Fixes

* getSitesByOrganizationID performance ([485818f](https://github.com/adobe/spacecat-shared/commit/485818f846c1ceb0e50b32f531bd2e438cee7614))


### Features

* introduce fixed URLs in audit type config ([#272](https://github.com/adobe/spacecat-shared/issues/272)) ([07858a9](https://github.com/adobe/spacecat-shared/commit/07858a95ce457f395fd2c4269d79b445f34de504))

# [@adobe/spacecat-shared-data-access-v1.32.0](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-data-access-v1.31.0...@adobe/spacecat-shared-data-access-v1.32.0) (2024-06-20)


Expand Down
8 changes: 4 additions & 4 deletions packages/spacecat-shared-data-access/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@adobe/spacecat-shared-data-access",
"version": "1.32.0",
"version": "1.33.0",
"description": "Shared modules of the Spacecat Services - Data Access",
"type": "module",
"main": "src/index.js",
Expand Down Expand Up @@ -31,10 +31,10 @@
"dependencies": {
"@adobe/spacecat-shared-dynamo": "1.2.5",
"@adobe/spacecat-shared-utils": "1.2.0",
"@aws-sdk/client-dynamodb": "3.598.0",
"@aws-sdk/lib-dynamodb": "3.598.0",
"@aws-sdk/client-dynamodb": "3.602.0",
"@aws-sdk/lib-dynamodb": "3.602.0",
"@types/joi": "17.2.3",
"joi": "17.13.1",
"joi": "17.13.3",
"uuid": "10.0.0"
},
"devDependencies": {
Expand Down
11 changes: 11 additions & 0 deletions packages/spacecat-shared-data-access/src/models/site/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ export const configSchema = Joi.object({
brokenTargetURL: Joi.string().optional(),
targetURL: Joi.string().optional(),
})).optional(),
fixedURLs: Joi.array().items(Joi.object({
brokenTargetURL: Joi.string().optional(),
targetURL: Joi.string().optional(),
})).optional(),
}).unknown(true)).unknown(true),
}).unknown(true);

Expand Down Expand Up @@ -56,6 +60,7 @@ export const Config = (data = {}) => {
self.getHandlers = () => state.handlers;
self.getExcludedURLs = (type) => state?.handlers[type]?.excludedURLs;
self.getManualOverrides = (type) => state?.handlers[type]?.manualOverwrites;
self.getFixedURLs = (type) => state?.handlers[type]?.fixedURLs;

self.updateSlackConfig = (channel, workspace, invitedUserCount) => {
state.slack = {
Expand Down Expand Up @@ -84,6 +89,12 @@ export const Config = (data = {}) => {
state.handlers[type].manualOverwrites = manualOverwrites;
};

self.updateFixedURLs = (type, fixedURLs) => {
state.handlers = state.handlers || {};
state.handlers[type] = state.handlers[type] || {};
state.handlers[type].fixedURLs = fixedURLs;
};

return Object.freeze(self);
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,6 @@ export const getSitesByOrganizationID = async (
ExpressionAttributeValues: {
':organizationId': organizationId,
},
Limit: 1,
});

return dynamoItems.map((dynamoItem) => SiteDto.fromDynamoItem(dynamoItem));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,17 @@ describe('Config Tests', () => {
const updatedManualOverrides = config.getManualOverrides('broken-backlinks');
expect(updatedManualOverrides).to.deep.equal(manualOverrides);
});

it('correctly updates the fixedURLs array to an empty array', () => {
const fixedURLs = [
{ brokenTargetURL: 'https://broken.co', targetURL: 'https://fixed.co' },
{ brokenTargetURL: 'https://broken.link.co', targetURL: 'https://fixed.link.co' },
];
const config = Config();
config.updateFixedURLs('broken-backlinks', fixedURLs);
config.updateFixedURLs('broken-backlinks', []);
expect(config.getFixedURLs('broken-backlinks')).to.be.an('array').that.is.empty;
});
});

describe('fromDynamoItem Static Method', () => {
Expand Down
4 changes: 2 additions & 2 deletions packages/spacecat-shared-dynamo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
"access": "public"
},
"dependencies": {
"@aws-sdk/client-dynamodb": "3.598.0",
"@aws-sdk/lib-dynamodb": "3.598.0",
"@aws-sdk/client-dynamodb": "3.602.0",
"@aws-sdk/lib-dynamodb": "3.602.0",
"@adobe/spacecat-shared-utils": "1.1.0"
},
"devDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions packages/spacecat-shared-google-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"@adobe/helix-universal": "5.0.5",
"@adobe/spacecat-shared-http-utils": "1.1.4",
"@adobe/spacecat-shared-utils": "1.15.1",
"@aws-sdk/client-secrets-manager": "3.598.0",
"@aws-sdk/client-secrets-manager": "3.600.0",
"google-auth-library": "9.11.0",
"googleapis": "140.0.0"
},
Expand All @@ -44,6 +44,6 @@
"nock": "13.5.4",
"sinon": "18.0.0",
"sinon-chai": "3.7.0",
"typescript": "5.4.5"
"typescript": "5.5.2"
}
}
2 changes: 1 addition & 1 deletion packages/spacecat-shared-gpt-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,6 @@
"nock": "13.5.4",
"sinon": "18.0.0",
"sinon-chai": "3.7.0",
"typescript": "5.4.5"
"typescript": "5.5.2"
}
}
2 changes: 1 addition & 1 deletion packages/spacecat-shared-ims-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,6 @@
"nock": "13.5.4",
"sinon": "18.0.0",
"sinon-chai": "3.7.0",
"typescript": "5.4.5"
"typescript": "5.5.2"
}
}
2 changes: 1 addition & 1 deletion packages/spacecat-shared-rum-api-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,6 @@
"nock": "13.5.4",
"sinon": "18.0.0",
"sinon-chai": "3.7.0",
"typescript": "5.4.5"
"typescript": "5.5.2"
}
}
4 changes: 2 additions & 2 deletions packages/spacecat-shared-slack-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"dependencies": {
"@adobe/helix-universal": "5.0.5",
"@adobe/spacecat-shared-utils": "1.7.2",
"@slack/web-api": "7.1.0"
"@slack/web-api": "7.2.0"
},
"devDependencies": {
"chai": "4.4.1",
Expand All @@ -40,6 +40,6 @@
"sinon": "18.0.0",
"sinon-chai": "3.7.0",
"slack-block-builder": "2.8.0",
"typescript": "5.4.5"
"typescript": "5.5.2"
}
}
4 changes: 2 additions & 2 deletions packages/spacecat-shared-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@
},
"dependencies": {
"@adobe/fetch": "4.1.8",
"@aws-sdk/client-s3": "3.598.0",
"@aws-sdk/client-sqs": "3.598.0",
"@aws-sdk/client-s3": "3.600.0",
"@aws-sdk/client-sqs": "3.600.0",
"@json2csv/plainjs": "7.0.6"
}
}

0 comments on commit f89e872

Please sign in to comment.