Skip to content

Commit

Permalink
test(multiple): clean up standalone flags (#30189)
Browse files Browse the repository at this point in the history
Removes all the remaining `standalone: true` usages since standalone is the default now.

(cherry picked from commit 2091769)
  • Loading branch information
crisbeto committed Dec 16, 2024
1 parent c92def4 commit 0eb9e2f
Show file tree
Hide file tree
Showing 175 changed files with 1 addition and 553 deletions.
1 change: 0 additions & 1 deletion src/cdk-experimental/combobox/combobox.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,6 @@ describe('Combobox', () => {
<button id="applyButton" (click)="toggleCombobox.updateAndClose(input.value)">Apply</button>
</div>
</ng-template>`,
standalone: true,
imports: [CdkComboboxModule],
})
class ComboboxToggle {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ function finishInit(fixture: ComponentFixture<any>) {
}
`,
encapsulation: ViewEncapsulation.None,
standalone: true,
imports: [ScrollingModule, ExperimentalScrollingModule],
})
class AutoSizeVirtualScroll {
Expand Down
4 changes: 0 additions & 4 deletions src/cdk-experimental/selection/selection.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,6 @@ describe('cdkSelectionColumn with multiple = false', () => {
</li>
}
</ul>`,
standalone: true,
imports: [CdkSelectionModule, AsyncPipe],
})
class ListWithMultiSelection {
Expand Down Expand Up @@ -517,7 +516,6 @@ class ListWithMultiSelection {
</li>
}
</ul>`,
standalone: true,
imports: [CdkSelectionModule, AsyncPipe],
})
class ListWithSingleSelection {
Expand Down Expand Up @@ -559,7 +557,6 @@ class ListWithSingleSelection {
cdkRowSelection [cdkRowSelectionValue]="row"></tr>
</table>
`,
standalone: true,
imports: [CdkSelectionModule, CdkTableModule],
})
class MultiSelectTableWithSelectionColumn {
Expand Down Expand Up @@ -627,7 +624,6 @@ class MultiSelectTableWithSelectionColumn {
cdkRowSelection [cdkRowSelectionValue]="row"></tr>
</table>
`,
standalone: true,
imports: [CdkSelectionModule, CdkTableModule],
})
class SingleSelectTableWithSelectionColumn {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,6 @@ class FakeDataSource extends DataSource<TestData> {
</table>
</div>
`,
standalone: true,
imports: [CdkTableModule, CdkTableScrollContainerModule],
styles: `
.cdk-header-cell, .cdk-cell, .cdk-footer-cell {
Expand Down
1 change: 0 additions & 1 deletion src/cdk/a11y/aria-describer/aria-describer.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,6 @@ function expectMessage(el: Element, message: string) {
<div id="description-with-existing-id">Hello</div>
<div description-without-id>Hey</div>
`,
standalone: true,
imports: [A11yModule],
})
class TestApp {
Expand Down
8 changes: 0 additions & 8 deletions src/cdk/a11y/focus-monitor/focus-monitor.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -901,14 +901,12 @@ describe('FocusMonitor input label detection', () => {

@Component({
template: `<div class="parent"><button>focus me!</button></div>`,
standalone: true,
imports: [A11yModule],
})
class PlainButton {}

@Component({
template: `<button cdkMonitorElementFocus (cdkFocusChange)="focusChanged($event)"></button>`,
standalone: true,
imports: [A11yModule],
})
class ButtonWithFocusClasses {
Expand All @@ -917,28 +915,24 @@ class ButtonWithFocusClasses {

@Component({
template: `<div tabindex="0" cdkMonitorElementFocus><button></button></div>`,
standalone: true,
imports: [A11yModule],
})
class ComplexComponentWithMonitorElementFocus {}

@Component({
template: `<div tabindex="0" cdkMonitorSubtreeFocus><button></button></div>`,
standalone: true,
imports: [A11yModule],
})
class ComplexComponentWithMonitorSubtreeFocus {}

@Component({
template: `<div cdkMonitorSubtreeFocus><button cdkMonitorElementFocus></button></div>`,
standalone: true,
imports: [A11yModule],
})
class ComplexComponentWithMonitorSubtreeFocusAndMonitorElementFocus {}

@Component({
template: `<ng-container cdkMonitorElementFocus></ng-container>`,
standalone: true,
imports: [A11yModule],
})
class FocusMonitorOnCommentNode {}
Expand All @@ -948,14 +942,12 @@ class FocusMonitorOnCommentNode {}
<label for="test-checkbox">Check me</label>
<input id="test-checkbox" type="checkbox">
`,
standalone: true,
imports: [A11yModule],
})
class CheckboxWithLabel {}

@Component({
template: `<button cdkMonitorElementFocus #exportedDir="cdkMonitorFocus"></button>`,
standalone: true,
imports: [A11yModule],
})
class ExportedFocusMonitor {
Expand Down
1 change: 0 additions & 1 deletion src/cdk/a11y/focus-monitor/focus-monitor.zone.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ describe('FocusMonitor observable stream Zone.js integration', () => {

@Component({
template: `<div class="parent"><button>focus me!</button></div>`,
standalone: true,
imports: [A11yModule],
})
class PlainButton {}
1 change: 0 additions & 1 deletion src/cdk/a11y/focus-trap/configurable-focus-trap.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ function createComponent<T>(
<button>SAVE</button>
</div>
`,
standalone: true,
})
class SimpleFocusTrap implements AfterViewInit {
private _focusTrapFactory = inject(ConfigurableFocusTrapFactory);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ function createComponent<T>(
<button #secondFocusable>SAVE</button>
</div>
`,
standalone: true,
})
class SimpleFocusTrap implements AfterViewInit {
private _focusTrapFactory = inject(ConfigurableFocusTrapFactory);
Expand Down
9 changes: 0 additions & 9 deletions src/cdk/a11y/focus-trap/focus-trap.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,6 @@ function getActiveElement() {
<button>SAVE</button>
</div>
`,
standalone: true,
imports: [A11yModule, PortalModule],
})
class SimpleFocusTrap {
Expand All @@ -371,7 +370,6 @@ const AUTO_FOCUS_TEMPLATE = `

@Component({
template: AUTO_FOCUS_TEMPLATE,
standalone: true,
imports: [A11yModule, PortalModule],
})
class FocusTrapWithAutoCapture {
Expand All @@ -383,7 +381,6 @@ class FocusTrapWithAutoCapture {
@Component({
template: AUTO_FOCUS_TEMPLATE,
encapsulation: ViewEncapsulation.ShadowDom,
standalone: true,
imports: [A11yModule, PortalModule],
})
class FocusTrapWithAutoCaptureInShadowDom extends FocusTrapWithAutoCapture {}
Expand All @@ -397,7 +394,6 @@ class FocusTrapWithAutoCaptureInShadowDom extends FocusTrapWithAutoCapture {}
</div>
}
`,
standalone: true,
imports: [A11yModule, PortalModule],
})
class FocusTrapWithBindings {
Expand All @@ -418,7 +414,6 @@ class FocusTrapWithBindings {
<input>
</div>
`,
standalone: true,
imports: [A11yModule, PortalModule],
})
class FocusTrapTargets {
Expand All @@ -431,7 +426,6 @@ class FocusTrapTargets {
<div cdkFocusInitial></div>
</div>
`,
standalone: true,
imports: [A11yModule, PortalModule],
})
class FocusTrapUnfocusableTarget {
Expand All @@ -446,7 +440,6 @@ class FocusTrapUnfocusableTarget {
</svg>
</div>
`,
standalone: true,
imports: [A11yModule, PortalModule],
})
class FocusTrapWithSvg {
Expand All @@ -459,7 +452,6 @@ class FocusTrapWithSvg {
<p>Hello</p>
</div>
`,
standalone: true,
imports: [A11yModule, PortalModule],
})
class FocusTrapWithoutFocusableElements {
Expand All @@ -478,7 +470,6 @@ class FocusTrapWithoutFocusableElements {
</div>
</ng-template>
`,
standalone: true,
imports: [A11yModule, PortalModule],
})
class FocusTrapInsidePortal {
Expand Down
2 changes: 1 addition & 1 deletion src/cdk/a11y/key-manager/list-key-manager.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ describe('Key managers', () => {
it('should maintain the active item when the signal-based items change', () => {
keyManager.destroy();

@Component({template: '', standalone: true})
@Component({template: ''})
class App {}

const fixture = TestBed.createComponent(App);
Expand Down
3 changes: 0 additions & 3 deletions src/cdk/a11y/live-announcer/live-announcer.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,6 @@ function getLiveElement(): Element {

@Component({
template: `<button (click)="announceText('Test')">Announce</button>`,
standalone: true,
imports: [A11yModule],
})
class TestApp {
Expand All @@ -406,7 +405,6 @@ class TestApp {
@Component({
template: '',
host: {'[attr.aria-owns]': 'ariaOwns', 'aria-modal': 'true'},
standalone: true,
imports: [A11yModule],
})
class TestModal {
Expand All @@ -418,7 +416,6 @@ class TestModal {
<div
[cdkAriaLive]="politeness ? politeness : null"
[cdkAriaLiveDuration]="duration">{{content}}</div>`,
standalone: true,
imports: [A11yModule],
})
class DivWithCdkAriaLive {
Expand Down
3 changes: 0 additions & 3 deletions src/cdk/accordion/accordion-item.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,6 @@ describe('CdkAccordionItem', () => {

@Component({
template: `<cdk-accordion-item #item1></cdk-accordion-item>`,
standalone: true,
imports: [CdkAccordionModule],
})
class SingleItem {}
Expand All @@ -248,7 +247,6 @@ class SingleItem {}
<cdk-accordion-item #item1></cdk-accordion-item>
<cdk-accordion-item #item2></cdk-accordion-item>
`,
standalone: true,
imports: [CdkAccordionModule],
})
class ItemGroupWithoutAccordion {}
Expand All @@ -260,7 +258,6 @@ class ItemGroupWithoutAccordion {}
<cdk-accordion-item #item2></cdk-accordion-item>
</cdk-accordion>
`,
standalone: true,
imports: [CdkAccordionModule],
})
class ItemGroupWithAccordion {}
2 changes: 0 additions & 2 deletions src/cdk/accordion/accordion.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ describe('CdkAccordion', () => {
<cdk-accordion-item></cdk-accordion-item>
<cdk-accordion-item></cdk-accordion-item>
</cdk-accordion>`,
standalone: true,
imports: [CdkAccordionModule],
})
class SetOfItems {
Expand All @@ -131,7 +130,6 @@ class SetOfItems {
<cdk-accordion-item #innerItem="cdkAccordionItem"></cdk-accordion-item>
</cdk-accordion-item>
</cdk-accordion>`,
standalone: true,
imports: [CdkAccordionModule],
})
class NestedItems {
Expand Down
4 changes: 0 additions & 4 deletions src/cdk/bidi/directionality.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,6 @@ describe('Directionality', () => {
@Component({
selector: 'injects-directionality',
template: `<div></div>`,
standalone: true,
imports: [BidiModule],
})
class InjectsDirectionality {
Expand All @@ -175,7 +174,6 @@ class InjectsDirectionality {
<injects-directionality></injects-directionality>
</div>
`,
standalone: true,
imports: [Dir, InjectsDirectionality],
})
class ElementWithDir {
Expand All @@ -186,7 +184,6 @@ class ElementWithDir {

@Component({
template: '<div dir="auto"></div>',
standalone: true,
imports: [Dir],
})
class ElementWithPredefinedAutoDir {
Expand All @@ -195,7 +192,6 @@ class ElementWithPredefinedAutoDir {

@Component({
template: '<div dir="RTL"></div>',
standalone: true,
imports: [Dir],
})
class ElementWithPredefinedUppercaseDir {
Expand Down
1 change: 0 additions & 1 deletion src/cdk/clipboard/copy-to-clipboard.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ const COPY_CONTENT = 'copy content';
[cdkCopyToClipboard]="content"
[cdkCopyToClipboardAttempts]="attempts"
(cdkCopyToClipboardCopied)="copied($event)"></button>`,
standalone: true,
imports: [ClipboardModule],
})
class CopyToClipboardHost {
Expand Down
Loading

0 comments on commit 0eb9e2f

Please sign in to comment.