Skip to content

Commit f3bdc9f

Browse files
committed
clarify wording for port tests
1 parent 21f6006 commit f3bdc9f

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

lib/util/url.spec.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -339,20 +339,24 @@ describe('util/url', () => {
339339
).toBe('https://dev.azure.com/my%20org/my%20project/_git/my%20repo/');
340340
});
341341

342-
it('leaves the origin untouched', () => {
342+
it('drops the default https port and encodes path segments', () => {
343343
const origin = 'https://dev.azure.com:443/';
344344
const encoded = encodeUrlPathSegments(
345345
`${origin}my org/my project/_git/my repo`,
346346
);
347-
expect(encoded.startsWith('https://dev.azure.com/')).toBe(true);
347+
expect(encoded).toBe(
348+
'https://dev.azure.com/my%20org/my%20project/_git/my%20repo',
349+
);
348350
});
349351

350-
it('preserves non-default ports', () => {
352+
it('preserves non-default ports and encodes path segments', () => {
351353
const origin = 'https://azure-devops.interal.corp:8080/tfs/';
352354
const encoded = encodeUrlPathSegments(
353355
`${origin}my org/my project/_git/my repo`,
354356
);
355-
expect(encoded.startsWith(origin)).toBe(true);
357+
expect(encoded).toBe(
358+
'https://azure-devops.interal.corp:8080/tfs/my%20org/my%20project/_git/my%20repo',
359+
);
356360
});
357361

358362
it('leaves a plain URL with no special characters unchanged (regression baseline)', () => {

0 commit comments

Comments
 (0)