Skip to content

Commit 1ee77bd

Browse files
author
Diana Manolache
committed
fix: Added test for cwv-trends-daily import type
1 parent 57c5fe8 commit 1ee77bd

File tree

1 file changed

+31
-1
lines changed
  • packages/spacecat-shared-data-access/test/unit/models/site

1 file changed

+31
-1
lines changed

packages/spacecat-shared-data-access/test/unit/models/site/config.test.js

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -943,6 +943,19 @@ describe('Config Tests', () => {
943943
expect(imports).to.have.length(1);
944944
expect(imports[0].sources).to.deep.equal(['google']);
945945
});
946+
947+
it('enables cwv-trends-daily import with default config', () => {
948+
const config = Config();
949+
config.enableImport('cwv-trends-daily');
950+
951+
const importConfig = config.getImportConfig('cwv-trends-daily');
952+
expect(importConfig).to.deep.equal({
953+
type: 'cwv-trends-daily',
954+
destinations: ['default'],
955+
sources: ['rum'],
956+
enabled: true,
957+
});
958+
});
946959
});
947960

948961
describe('disableImport method', () => {
@@ -1132,6 +1145,12 @@ describe('Config Tests', () => {
11321145
sources: ['rum'],
11331146
enabled: true,
11341147
},
1148+
{
1149+
type: 'cwv-trends-daily',
1150+
destinations: ['default'],
1151+
sources: ['rum'],
1152+
enabled: true,
1153+
},
11351154
],
11361155
fetchConfig: {
11371156
headers: {
@@ -1185,7 +1204,7 @@ describe('Config Tests', () => {
11851204
.to.throw().and.satisfy((error) => {
11861205
expect(error.message).to.include('Configuration validation error');
11871206
expect(error.cause.details[0].context.message)
1188-
.to.equal('"imports[0].type" must be [llmo-prompts-ahrefs]. "imports[0].destinations[0]" must be [default]. "imports[0].type" must be [organic-keywords-nonbranded]. "imports[0].type" must be [organic-keywords-ai-overview]. "imports[0].type" must be [organic-keywords-feature-snippets]. "imports[0].type" must be [organic-keywords-questions]. "imports[0].type" must be [organic-traffic]. "imports[0].type" must be [all-traffic]. "imports[0].type" must be [top-pages]. "imports[0].type" must be [ahref-paid-pages]. "imports[0].type" must be [cwv-daily]. "imports[0].type" must be [cwv-weekly]. "imports[0].type" must be [traffic-analysis]. "imports[0].type" must be [top-forms]. "imports[0].type" must be [user-engagement]');
1207+
.to.equal('"imports[0].type" must be [llmo-prompts-ahrefs]. "imports[0].destinations[0]" must be [default]. "imports[0].type" must be [organic-keywords-nonbranded]. "imports[0].type" must be [organic-keywords-ai-overview]. "imports[0].type" must be [organic-keywords-feature-snippets]. "imports[0].type" must be [organic-keywords-questions]. "imports[0].type" must be [organic-traffic]. "imports[0].type" must be [all-traffic]. "imports[0].type" must be [top-pages]. "imports[0].type" must be [ahref-paid-pages]. "imports[0].type" must be [cwv-daily]. "imports[0].type" must be [cwv-weekly]. "imports[0].type" must be [traffic-analysis]. "imports[0].type" must be [top-forms]. "imports[0].type" must be [user-engagement]. "imports[0].type" must be [cwv-trends-daily]');
11891208
expect(error.cause.details[0].context.details)
11901209
.to.eql([
11911210
{
@@ -1340,6 +1359,17 @@ describe('Config Tests', () => {
13401359
key: 'type',
13411360
},
13421361
},
1362+
{
1363+
message: '"imports[0].type" must be [cwv-trends-daily]',
1364+
path: ['imports', 0, 'type'],
1365+
type: 'any.only',
1366+
context: {
1367+
valids: ['cwv-trends-daily'],
1368+
label: 'imports[0].type',
1369+
value: 'organic-keywords',
1370+
key: 'type',
1371+
},
1372+
},
13431373
]);
13441374
return true;
13451375
});

0 commit comments

Comments
 (0)