Skip to content

Conversation

@Raubzeug
Copy link
Contributor

@Raubzeug Raubzeug commented Sep 27, 2024

CI Results

Test Status: βœ… PASSED

πŸ“Š Full Report

Total Passed Failed Flaky Skipped
124 124 0 0 0

Bundle Size: βœ…

Current: 79.08 MB | Main: 79.08 MB
Diff: +0.00 MB (0.00%)

βœ… Bundle size unchanged.

ℹ️ CI Information
  • Test recordings for failed tests are available in the full report.
  • Bundle size is measured for the entire 'dist' directory.
  • πŸ“Š indicates links to detailed reports.
  • πŸ”Ί indicates increase, πŸ”½ decrease, and βœ… no change in bundle size.

@Raubzeug Raubzeug linked an issue Sep 27, 2024 that may be closed by this pull request
return result;
}

export function isDomain(path: string, type?: EPathType) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some tests would be very great

return result;
}

export function isDomain(path: string, type?: EPathType) {
Copy link
Collaborator

@astandrik astandrik Sep 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

export function isDomain(path: string, type?: EPathType): boolean {
    if (type !== EPathType.EPathTypeDir) {
        return false;
    }

    return path.split('/').length === 2 && path.startsWith('/');
}

return result;
}

export function isDomain(path: string, type?: EPathType) {
Copy link
Collaborator

@astandrik astandrik Sep 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if these tests return what expected
Double check them please

import { isDomain } from './path-utils';
import { EPathType } from './types';

describe('isDomain', () => {
    it('should return true for valid domain paths', () => {
        expect(isDomain('/domain', EPathType.EPathTypeDir)).toBe(true);
        expect(isDomain('/another-domain', EPathType.EPathTypeDir)).toBe(true);
    });

    it('should return false for non-directory paths', () => {
        expect(isDomain('/domain', EPathType.EPathTypeFile)).toBe(false);
        expect(isDomain('/domain', undefined)).toBe(false);
    });

    it('should return false for paths without slash', () => {
        expect(isDomain('domain', EPathType.EPathTypeDir)).toBe(false);
    });

    it('should return false for paths with multiple slashes', () => {
        expect(isDomain('/domain/subdomain', EPathType.EPathTypeDir)).toBe(false);
        expect(isDomain('/domain/', EPathType.EPathTypeDir)).toBe(false);
    });

    it('should return false for empty paths', () => {
        expect(isDomain('', EPathType.EPathTypeDir)).toBe(false);
    });

    it('should return true for root path', () => {
        expect(isDomain('/', EPathType.EPathTypeDir)).toBe(true);
    });
});

@Raubzeug Raubzeug requested a review from astandrik September 27, 2024 15:25
@Raubzeug Raubzeug added this pull request to the merge queue Sep 30, 2024
Merged via the queue into main with commit 418d3d8 Sep 30, 2024
6 checks passed
@Raubzeug Raubzeug deleted the 1329-copy-path branch September 30, 2024 13:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Do not include db path in copy object path

4 participants