Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: use relative entity path in schema actions #1366

Merged
merged 2 commits into from
Sep 30, 2024
Merged

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
@@ -14,3 +19,19 @@ export function transformPath(path: string, dbName: string): string {

return result;
}

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

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

@@ -14,3 +19,19 @@ export function transformPath(path: string, dbName: string): string {

return result;
}

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

@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('/');
}

@@ -14,3 +19,19 @@ export function transformPath(path: string, dbName: string): string {

return result;
}

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

@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 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
3 participants