Skip to content

Commit

Permalink
fix(#2162): rebase with alpha 1.17.0-alpha.119
Browse files Browse the repository at this point in the history
  • Loading branch information
vanessatran-ddi committed Nov 7, 2024
1 parent b511f21 commit ff2fd5a
Show file tree
Hide file tree
Showing 103 changed files with 286 additions and 342 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { GoabAccordion } from "./accordion";
import { ComponentFixture, TestBed } from "@angular/core/testing";
import { CUSTOM_ELEMENTS_SCHEMA, Component } from "@angular/core";
import { By } from "@angular/platform-browser";
import { GoabAccordionHeadingSize } from "@abgov/ui-components-common";
import { GoabAccordionHeadingSize, GoabAccordionIconPosition } from "@abgov/ui-components-common";

@Component({
template: `
Expand All @@ -12,6 +12,7 @@ import { GoabAccordionHeadingSize } from "@abgov/ui-components-common";
[open]="open"
[headingSize]="headingSize"
[headingContent]="headingContent"
[iconPosition]="iconPosition"
maxWidth="480px"
>
test content
Expand All @@ -23,9 +24,10 @@ class TestAccordionComponent {
secondaryText?: string;
open?: boolean;
headingSize?: GoabAccordionHeadingSize;
iconPosition?: GoabAccordionIconPosition;
}

describe("GoABAccordion", () => {
describe("GoabAccordion", () => {
let fixture: ComponentFixture<TestAccordionComponent>;
let component: TestAccordionComponent;

Expand All @@ -42,6 +44,7 @@ describe("GoABAccordion", () => {
component.secondaryText = "Secondary Text";
component.open = true;
component.headingSize = "large" as GoabAccordionHeadingSize;
component.iconPosition = "right" as GoabAccordionIconPosition;

fixture.detectChanges();
});
Expand All @@ -55,6 +58,7 @@ describe("GoABAccordion", () => {
expect(accordionElement.getAttribute("open")).toBe("true");
expect(accordionElement.getAttribute("headingsize")).toBe("large");
expect(accordionElement.getAttribute("maxwidth")).toBe("480px");
expect(accordionElement.getAttribute("iconposition")).toBe("right");
const headingContent = accordionElement.querySelector("[slot='headingcontent']");
expect(headingContent.textContent).toContain("This is the headingcontent");
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { GoabAccordionHeadingSize, Spacing } from "@abgov/ui-components-common";
import { GoabAccordionHeadingSize, GoabAccordionIconPosition, Spacing } from "@abgov/ui-components-common";
import { CUSTOM_ELEMENTS_SCHEMA, Component, Input, TemplateRef } from "@angular/core";
import { NgTemplateOutlet } from "@angular/common";

Expand All @@ -14,6 +14,7 @@ import { NgTemplateOutlet } from "@angular/common";
[attr.headingsize]="headingSize"
[attr.maxwidth]="maxWidth"
[attr.testid]="testId"
[attr.iconposition]="iconPosition"
[attr.mt]="mt"
[attr.mb]="mb"
[attr.ml]="ml"
Expand All @@ -35,6 +36,7 @@ export class GoabAccordion {
@Input() headingSize?: GoabAccordionHeadingSize;
@Input() headingContent!: TemplateRef<any>;
@Input() maxWidth?: string;
@Input() iconPosition?: GoabAccordionIconPosition;
@Input() mt?: Spacing;
@Input() mb?: Spacing;
@Input() ml?: Spacing;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ describe("GoABBlock", () => {
expect(blockElement.getAttribute("gap")).toBe(component.gap);
expect(blockElement.getAttribute("direction")).toBe(component.direction);
expect(blockElement.getAttribute("alignment")).toBe(component.alignment);
expect(blockElement.getAttribute("data-testid")).toBe(component.testId);
expect(blockElement.getAttribute("testid")).toBe(component.testId);
expect(blockElement.getAttribute("mt")).toBe(component.mt);
expect(blockElement.getAttribute("mb")).toBe(component.mb);
expect(blockElement.getAttribute("ml")).toBe(component.ml);
Expand Down
2 changes: 1 addition & 1 deletion libs/angular-components/src/lib/components/block/block.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { CUSTOM_ELEMENTS_SCHEMA, Component, Input } from "@angular/core";
[attr.gap]="gap"
[attr.direction]="direction"
[attr.alignment]="alignment"
[attr.data-testid]="testId"
[attr.testid]="testId"
[attr.mt]="mt"
[attr.mb]="mb"
[attr.ml]="ml"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ describe("GoABButtonGroup", () => {
).nativeElement;
expect(buttonGroupElement.getAttribute("alignment")).toBe(component.alignment);
expect(buttonGroupElement.getAttribute("gap")).toBe(component.gap);
expect(buttonGroupElement.getAttribute("data-testid")).toBe(component.testId);
expect(buttonGroupElement.getAttribute("testid")).toBe(component.testId);
expect(buttonGroupElement.getAttribute("mt")).toBe(component.mt);
expect(buttonGroupElement.getAttribute("mb")).toBe(component.mb);
expect(buttonGroupElement.getAttribute("ml")).toBe(component.ml);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { CUSTOM_ELEMENTS_SCHEMA, Component, Input } from "@angular/core";
<goa-button-group
[attr.alignment]="alignment"
[attr.gap]="gap"
[attr.data-testid]="testId"
[attr.testid]="testId"
[attr.mt]="mt"
[attr.mb]="mb"
[attr.ml]="ml"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { CUSTOM_ELEMENTS_SCHEMA, Component, EventEmitter, Input, Output } from "
[disabled]="disabled"
[attr.leadingicon]="leadingIcon"
[attr.trailingicon]="trailingIcon"
[attr.data-testid]="testId"
[attr.testid]="testId"
[attr.mt]="mt"
[attr.mb]="mb"
[attr.ml]="ml"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ describe("GoABCalendar", () => {
expect(calendar.getAttribute("name")).toBe(component.name);
expect(calendar.getAttribute("min")).toBe(component.min?.toString());
expect(calendar.getAttribute("max")).toBe(component.max?.toString());
expect(calendar.getAttribute("data-testid")).toBe(component.testId);
expect(calendar.getAttribute("testid")).toBe(component.testId);
expect(calendar.getAttribute("mt")).toBe(component.mt);
expect(calendar.getAttribute("mb")).toBe(component.mb);
expect(calendar.getAttribute("ml")).toBe(component.ml);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { CUSTOM_ELEMENTS_SCHEMA, Component, EventEmitter, Input, Output } from "
[value]="value"
[attr.min]="min"
[attr.max]="max"
[attr.data-testid]="testId"
[attr.testid]="testId"
[attr.mt]="mt"
[attr.mb]="mb"
[attr.ml]="ml"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { GoabCalloutAriaLive, GoabCalloutSize, GoabCalloutType, Spacing } from "@abgov/ui-components-common";
import { GoabCalloutAriaLive, GoabCalloutSize, GoabCalloutType, Spacing, GoabCalloutIconTheme} from "@abgov/ui-components-common";
import { CUSTOM_ELEMENTS_SCHEMA, Component, Input } from "@angular/core";

@Component({
Expand All @@ -11,6 +11,7 @@ import { CUSTOM_ELEMENTS_SCHEMA, Component, Input } from "@angular/core";
[attr.size]="size"
[attr.maxwidth]="maxWidth"
[attr.arialive]="ariaLive"
[attr.icontheme]="iconTheme"
[attr.testid]="testId"
[attr.mt]="mt"
[attr.mb]="mb"
Expand All @@ -28,6 +29,7 @@ export class GoabCallout {
@Input() size?: GoabCalloutSize = "large";
@Input() maxWidth?: string;
@Input() ariaLive?: GoabCalloutAriaLive = "off";
@Input() iconTheme?: GoabCalloutIconTheme = "outline";
@Input() testId?: string;
@Input() mt?: Spacing;
@Input() mb?: Spacing;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import { CUSTOM_ELEMENTS_SCHEMA, Component, Input } from "@angular/core";
selector: "goab-card-image",
template: `
<goa-card-image
[src]="src"
[height]="height"
[attr.src]="src"
[attr.height]="height"
>
<ng-content />
</goa-card-image>
Expand Down
15 changes: 12 additions & 3 deletions libs/angular-components/src/lib/components/card/card.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
import { CUSTOM_ELEMENTS_SCHEMA, Component, Input } from "@angular/core";
import { Spacing } from "@abgov/ui-components-common";

@Component({
standalone: true,
selector: "goab-card",
template: `
<goa-card
[elevation]="elevation"
[width]="width"
[testid]="testId"
[attr.elevation]="elevation"
[attr.width]="width"
[attr.testid]="testId"
[attr.mt]="mt"
[attr.mb]="mb"
[attr.ml]="ml"
[attr.mr]="mr"
>
<ng-content />
</goa-card>
Expand All @@ -18,4 +23,8 @@ export class GoabCard {
@Input() elevation?: number;
@Input() width?: string;
@Input() testId?: string;
@Input() mt?: Spacing;
@Input() mb?: Spacing;
@Input() ml?: Spacing;
@Input() mr?: Spacing;
}
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ describe("GoABCheckbox", () => {
).nativeElement;
expect(checkboxElement.getAttribute("name")).toBe(component.name);
expect(checkboxElement.getAttribute("text")).toBe(component.text);
expect(checkboxElement.getAttribute("data-testid")).toBe(component.testId);
expect(checkboxElement.getAttribute("testid")).toBe(component.testId);
expect(checkboxElement.getAttribute("mt")).toBe(component.mt);
expect(checkboxElement.getAttribute("mr")).toBe(component.mr);
expect(checkboxElement.getAttribute("mb")).toBe(component.mb);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { NgTemplateOutlet } from "@angular/common";
[attr.error]="error"
[attr.text]="text"
[value]="value"
[attr.data-testid]="testId"
[attr.testid]="testId"
[attr.arialabel]="ariaLabel"
[attr.description]="getDescriptionAsString()"
[id]="id"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ describe("GoABChip", () => {
expect(chipElement.getAttribute("content")).toBe(component.content);
expect(chipElement.getAttribute("variant")).toBe(`${component.variant}`);
expect(chipElement.getAttribute("icontheme")).toBe(`${component.iconTheme}`);
expect(chipElement.getAttribute("data-testid")).toBe(component.testId);
expect(chipElement.getAttribute("testid")).toBe(component.testId);
expect(chipElement.getAttribute("mt")).toBe(component.mt);
expect(chipElement.getAttribute("mr")).toBe(component.mr);
expect(chipElement.getAttribute("mb")).toBe(component.mb);
Expand Down
2 changes: 1 addition & 1 deletion libs/angular-components/src/lib/components/chip/chip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { CUSTOM_ELEMENTS_SCHEMA, Component, Input, Output, EventEmitter } from "
[attr.deletable]="deletable"
[attr.icontheme]="iconTheme"
[attr.content]="content"
[attr.data-testid]="testId"
[attr.testid]="testId"
[attr.mt]="mt"
[attr.mb]="mb"
[attr.ml]="ml"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ describe("GoABCircularProgress", () => {
).nativeElement;
expect(el?.getAttribute("progress")).toBe(`${progress}`);
expect(el?.getAttribute("message")).toBe(component.message);
expect(el?.getAttribute("data-testid")).toBe(component.testId);
expect(el?.getAttribute("testid")).toBe(component.testId);
expect(el?.getAttribute("variant")).toBe(variant);
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { GoabCircularProgressSize, GoabCircularProgressVariant } from "@abgov/ui
[attr.message]="message"
[attr.visible]="visible"
[attr.progress]="progress"
[attr.data-testid]="testId"
[attr.testid]="testId"
>
</goa-circular-progress>
`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { NgTemplateOutlet } from "@angular/common";
[attr.padding]="padding"
[attr.width]="width"
[attr.maxwidth]="maxWidth"
[attr.data-testid]="testId"
[attr.testid]="testId"
[attr.mt]="mt"
[attr.mb]="mb"
[attr.ml]="ml"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { ControlValueAccessor, NG_VALUE_ACCESSOR } from "@angular/forms";
[attr.error]="error"
[attr.disabled]="disabled"
[attr.relative]="relative"
[attr.data-testid]="testId"
[attr.testid]="testId"
[attr.mt]="mt"
[attr.mb]="mb"
[attr.ml]="ml"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ describe("GoABDetails", () => {
expect(el?.getAttribute("mb")).toBe(component.mb);
expect(el?.getAttribute("mr")).toBe(component.mr);
expect(el?.getAttribute("ml")).toBe(component.ml);
expect(el?.getAttribute("data-testid")).toBe(component.testId);
expect(el?.getAttribute("testid")).toBe(component.testId);
expect(el?.innerHTML).toContain("The content");
expect(el?.getAttribute("maxwidth")).toBe("480px");
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { CUSTOM_ELEMENTS_SCHEMA, Component, Input } from "@angular/core";
template: `
<goa-details
[attr.heading]="heading"
[attr.data-testid]="testId"
[attr.testid]="testId"
[attr.open]="open"
[attr.maxwidth]="maxWidth"
[attr.mt]="mt"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ describe("GoABDivider", () => {

it("should render", () => {
const el = fixture.debugElement.query(By.css("goa-divider")).nativeElement;
expect(el?.getAttribute("data-testid")).toBe(component.testId);
expect(el?.getAttribute("testid")).toBe(component.testId);
expect(el?.getAttribute("mt")).toBe("s");
expect(el?.getAttribute("mr")).toBe("m");
expect(el?.getAttribute("mb")).toBe("l");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { CUSTOM_ELEMENTS_SCHEMA, Component, Input } from "@angular/core";
selector: "goab-divider",
template: `
<goa-divider
[attr.data-testid]="testId"
[attr.testid]="testId"
[attr.mt]="mt"
[attr.mb]="mb"
[attr.ml]="ml"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { GoabDropdownItemMountType } from "@abgov/ui-components-common";
selector: "goab-dropdown-item",
template: `
<goa-dropdown-item
[attr.data-testid]="testId"
[value]="value"
[label]="label"
[attr.filter]="filter"
Expand All @@ -23,7 +22,6 @@ export class GoabDropdownItem {
@Input() label?: string;
@Input() name?: string;
@Input() mountType?: GoabDropdownItemMountType;
@Input() testId?: string;
}


Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import { ControlValueAccessor, NG_VALUE_ACCESSOR } from "@angular/forms";
[attr.multiselect]="multiselect"
[attr.native]="native"
[attr.placeholder]="placeholder"
[attr.data-testid]="testId"
[attr.testid]="testId"
[attr.width]="width"
[attr.relative]="relative"
[id]="id"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ describe("GoABFileUploadCard", () => {
expect(el?.getAttribute("type")).toBe("image/png");
expect(el?.getAttribute("progress")).toBe("23");
expect(el?.getAttribute("error")).toBe("true");
expect(el?.getAttribute("data-testid")).toBe("foo");
expect(el?.getAttribute("testid")).toBe("foo");
});

it("should dispatch an even when delete is clicked and upload is complete", () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { GoabFileUploadOnCancelDetail, GoabFileUploadOnDeleteDetail, Spacing } from "@abgov/ui-components-common";
import { GoabFileUploadOnCancelDetail, GoabFileUploadOnDeleteDetail } from "@abgov/ui-components-common";
import { CUSTOM_ELEMENTS_SCHEMA, Component, EventEmitter, Input, Output } from "@angular/core";

@Component({
Expand All @@ -10,11 +10,7 @@ import { CUSTOM_ELEMENTS_SCHEMA, Component, EventEmitter, Input, Output } from "
[attr.type]="type"
[attr.progress]="progress"
[attr.error]="error"
[attr.data-testid]="testId"
[attr.mt]="mt"
[attr.mb]="mb"
[attr.mr]="mr"
[attr.ml]="ml"
[attr.testid]="testId"
(_cancel)="_onCancel()"
(_delete)="_onDelete()"
>
Expand All @@ -23,10 +19,6 @@ import { CUSTOM_ELEMENTS_SCHEMA, Component, EventEmitter, Input, Output } from "
})
export class GoabFileUploadCard {
@Input({ required: true }) filename!: string;
@Input() mt?: Spacing;
@Input() mb?: Spacing;
@Input() mr?: Spacing;
@Input() ml?: Spacing;
@Input() size?: number;
@Input() type?: string;
@Input() progress?: number;
Expand Down
Loading

0 comments on commit ff2fd5a

Please sign in to comment.