Skip to content

Commit

Permalink
feat(edit-content) fix comments #28764
Browse files Browse the repository at this point in the history
  • Loading branch information
oidacra committed Jun 26, 2024
1 parent 880abe7 commit 8710b53
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 14 deletions.
6 changes: 3 additions & 3 deletions core-web/.husky/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ perform_fixes() {
local add_to_index=$2 # Should be 'true' or 'false'
local file # Declare file variable for use in loop

if ! npx nx format:write; then
error_occurred=true
fi
# if ! npx nx format:write; then
# error_occurred=true
# fi

if ! npx nx affected -t lint --exclude='tag:skip:lint' --fix=true; then
error_occurred=true
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
@use "variables" as *;

.category-field__header {
height: 60px;
align-items: center;
flex-wrap: wrap;
gap: $spacing-0;
padding: 0 $spacing-4;
padding: $spacing-2 $spacing-4;
}

.category-field__header-title {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { expect, it } from '@jest/globals';
import { byTestId, createComponentFactory, Spectator } from '@ngneat/spectator';
import { mockProvider } from '@ngneat/spectator/jest';
import { byTestId, createComponentFactory, mockProvider, Spectator } from '@ngneat/spectator/jest';

import { fakeAsync } from '@angular/core/testing';

import { DotMessageService } from '@dotcms/data-access';

import { DotEditContentCategoryFieldSidebarComponent } from './components/dot-edit-content-category-field-sidebar/dot-edit-content-category-field-sidebar.component';
import { DotEditContentCategoryFieldComponent } from './dot-edit-content-category-field.component';
import { CLOSE_SIDEBAR_CSS_DELAY_MS } from './dot-edit-content-category-field.const';

describe('DotEditContentCategoryFieldComponent', () => {
let spectator: Spectator<DotEditContentCategoryFieldComponent>;
Expand Down Expand Up @@ -71,7 +72,7 @@ describe('DotEditContentCategoryFieldComponent', () => {
expect(spectator.query(DotEditContentCategoryFieldSidebarComponent)).not.toBeNull();
});

it('should remove DotEditContentCategoryFieldSidebarComponent when `closedSidebar` emit', async () => {
it('should remove DotEditContentCategoryFieldSidebarComponent when `closedSidebar` emit', fakeAsync(() => {
const selectBtn = spectator.query(byTestId('show-sidebar-btn')) as HTMLButtonElement;
expect(selectBtn).not.toBeNull();
spectator.click(selectBtn);
Expand All @@ -86,12 +87,11 @@ describe('DotEditContentCategoryFieldComponent', () => {
spectator.detectComponentChanges();

// Due to a delay in the pipe of the subscription
await new Promise((resolve) => setTimeout(resolve, 400));
spectator.tick(CLOSE_SIDEBAR_CSS_DELAY_MS + 100);

expect(spectator.query(DotEditContentCategoryFieldSidebarComponent)).toBeNull();

spectator.detectComponentChanges();
expect(selectBtn.disabled).toBe(false);
});
}));
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ import { DotCMSContentTypeField } from '@dotcms/dotcms-models';
import { DotDynamicDirective, DotMessagePipe } from '@dotcms/ui';

import { DotEditContentCategoryFieldSidebarComponent } from './components/dot-edit-content-category-field-sidebar/dot-edit-content-category-field-sidebar.component';

const CLOSE_SIDEBAR_CSS_DELAY_MS = 300;
import { CLOSE_SIDEBAR_CSS_DELAY_MS } from './dot-edit-content-category-field.const';

/**
* Component for editing content category field.
Expand Down

0 comments on commit 8710b53

Please sign in to comment.