Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 0f3adea

Browse files
committedMar 18, 2025·
🙈
1 parent a2b95c1 commit 0f3adea

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed
 

‎packages/sdks/src/functions/get-content/__snapshots__/generate-content-url.test.ts.snap

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ exports[`Generate Content URL > generates the proper value for a simple query 1`
3232

3333
exports[`Generate Content URL > handles empty string as omit parameter values > omit-empty-string 1`] = `"https://cdn.builder.io/api/v3/content/page?apiKey=YJIGb4i01jvw0SRdL5Bt&limit=30&noTraverse=true&includeRefs=true&omit="`;
3434

35-
exports[`Generate Content URL > handles defined string as omit parameter values > omit-null 1`] = `"https://cdn.builder.io/api/v3/content/page?apiKey=YJIGb4i01jvw0SRdL5Bt&limit=30&noTraverse=true&includeRefs=true&omit=name"`;
35+
exports[`Generate Content URL > handles defined string as omit parameter values > omit-defined 1`] = `"https://cdn.builder.io/api/v3/content/page?apiKey=YJIGb4i01jvw0SRdL5Bt&limit=30&noTraverse=true&includeRefs=true&omit=name"`;
3636

3737
exports[`Generate Content URL > handles undefined as omit parameter values > omit-undefined 1`] = `"https://cdn.builder.io/api/v3/content/page?apiKey=YJIGb4i01jvw0SRdL5Bt&limit=30&noTraverse=true&includeRefs=true&omit=meta.componentsUsed"`;
3838

‎packages/sdks/src/functions/get-content/generate-content-url.test.ts

+4-7
Original file line numberDiff line numberDiff line change
@@ -36,29 +36,26 @@ describe('Generate Content URL', () => {
3636
});
3737

3838
test('handles undefined, defined, and empty string as omit parameter values', () => {
39-
// Test with undefined (should default to 'meta.componentsUsed')
4039
const outputUndefined = generateContentUrl({
4140
apiKey: testKey,
4241
model: testModel,
4342
omit: undefined,
4443
});
45-
expect(outputUndefined).toMatchSnapshot('omit-undefined');
44+
expect(outputUndefined).toMatchSnapshot();
4645

47-
// Test with null (should default to 'meta.componentsUsed')
48-
const outputNull = generateContentUrl({
46+
const outputDefined = generateContentUrl({
4947
apiKey: testKey,
5048
model: testModel,
5149
omit: 'name',
5250
});
53-
expect(outputNull).toMatchSnapshot('omit-null');
51+
expect(outputDefined).toMatchSnapshot();
5452

55-
// Test with empty string (should set empty string as omit value)
5653
const outputEmptyString = generateContentUrl({
5754
apiKey: testKey,
5855
model: testModel,
5956
omit: '',
6057
});
61-
expect(outputEmptyString).toMatchSnapshot('omit-empty-string');
58+
expect(outputEmptyString).toMatchSnapshot();
6259
});
6360

6461
test('generate content url with apiVersion as default', () => {

0 commit comments

Comments
 (0)
Please sign in to comment.