Skip to content

fix: import paths that are missing /index #2831

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions showcase/app/routes/components/accordion.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

import Route from '@ember/routing/route';

import { SIZES } from '@hashicorp/design-system-components/components/hds/accordion/item';
import { TYPES } from '@hashicorp/design-system-components/components/hds/accordion/item';
import { SIZES } from '@hashicorp/design-system-components/components/hds/accordion/item/index';
import { TYPES } from '@hashicorp/design-system-components/components/hds/accordion/item/index';

export default class ComponentsAccordionRoute extends Route {
model() {
Expand Down
2 changes: 1 addition & 1 deletion showcase/app/routes/components/advanced-table.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*/

import Route from '@ember/routing/route';
import { DENSITIES } from '@hashicorp/design-system-components/components/hds/table';
import { DENSITIES } from '@hashicorp/design-system-components/components/hds/table/index';

const STATES = ['default', 'hover', 'active', 'focus'];

Expand Down
2 changes: 1 addition & 1 deletion showcase/app/routes/components/alert.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import Route from '@ember/routing/route';
import {
TYPES,
COLORS,
} from '@hashicorp/design-system-components/components/hds/alert';
} from '@hashicorp/design-system-components/components/hds/alert/index';

export default class ComponentsAlertRoute extends Route {
model() {
Expand Down
2 changes: 1 addition & 1 deletion showcase/app/routes/components/application-state.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import Route from '@ember/routing/route';

import { ALIGNS } from '@hashicorp/design-system-components/components/hds/application-state';
import { ALIGNS } from '@hashicorp/design-system-components/components/hds/application-state/index';

export default class ComponentsApplicationStateRoute extends Route {
model() {
Expand Down
2 changes: 1 addition & 1 deletion showcase/app/routes/components/badge-count.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
SIZES as BADGE_COUNT_SIZES,
TYPES as BADGE_COUNT_TYPES,
COLORS as BADGE_COUNT_COLORS,
} from '@hashicorp/design-system-components/components/hds/badge-count';
} from '@hashicorp/design-system-components/components/hds/badge-count/index';

export default class ComponentsBadgeCountRoute extends Route {
model() {
Expand Down
2 changes: 1 addition & 1 deletion showcase/app/routes/components/badge.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
SIZES as BADGE_SIZES,
TYPES as BADGE_TYPES,
COLORS as BADGE_COLORS,
} from '@hashicorp/design-system-components/components/hds/badge';
} from '@hashicorp/design-system-components/components/hds/badge/index';

export default class ComponentsBadgeRoute extends Route {
model() {
Expand Down
2 changes: 1 addition & 1 deletion showcase/app/routes/components/button.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import Route from '@ember/routing/route';
import {
SIZES,
COLORS,
} from '@hashicorp/design-system-components/components/hds/button';
} from '@hashicorp/design-system-components/components/hds/button/index';
export default class ComponentsButtonRoute extends Route {
model() {
// these are used only for presentation purpose in the showcase
Expand Down
2 changes: 1 addition & 1 deletion showcase/app/routes/components/code-block.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import Route from '@ember/routing/route';
import {
SUCCESS_ICON,
ERROR_ICON,
} from '@hashicorp/design-system-components/components/hds/copy/button';
} from '@hashicorp/design-system-components/components/hds/copy/button/index';

export default class ComponentsCodeBlockRoute extends Route {
model() {
Expand Down
2 changes: 1 addition & 1 deletion showcase/app/routes/components/copy/button.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
SIZES,
SUCCESS_ICON,
ERROR_ICON,
} from '@hashicorp/design-system-components/components/hds/copy/button';
} from '@hashicorp/design-system-components/components/hds/copy/button/index';

export default class ComponentsCopyButtonRoute extends Route {
model() {
Expand Down
2 changes: 1 addition & 1 deletion showcase/app/routes/components/copy/snippet.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
COLORS,
SUCCESS_ICON,
ERROR_ICON,
} from '@hashicorp/design-system-components/components/hds/copy/snippet';
} from '@hashicorp/design-system-components/components/hds/copy/snippet/index';

export default class ComponentsCopySnippetRoute extends Route {
model() {
Expand Down
2 changes: 1 addition & 1 deletion showcase/app/routes/components/flyout.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import Route from '@ember/routing/route';

import { SIZES } from '@hashicorp/design-system-components/components/hds/flyout';
import { SIZES } from '@hashicorp/design-system-components/components/hds/flyout/index';

export default class ComponentsFlyoutRoute extends Route {
model() {
Expand Down
2 changes: 1 addition & 1 deletion showcase/app/routes/components/icon-tile.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
SIZES,
COLORS,
PRODUCTS,
} from '@hashicorp/design-system-components/components/hds/icon-tile';
} from '@hashicorp/design-system-components/components/hds/icon-tile/index';

export default class ComponentsIconTileRoute extends Route {
model() {
Expand Down
2 changes: 1 addition & 1 deletion showcase/app/routes/components/modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import Route from '@ember/routing/route';
import {
COLORS,
SIZES,
} from '@hashicorp/design-system-components/components/hds/modal';
} from '@hashicorp/design-system-components/components/hds/modal/index';

export default class ComponentsModalRoute extends Route {
model() {
Expand Down
2 changes: 1 addition & 1 deletion showcase/app/routes/components/table.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*/

import Route from '@ember/routing/route';
import { DENSITIES } from '@hashicorp/design-system-components/components/hds/table';
import { DENSITIES } from '@hashicorp/design-system-components/components/hds/table/index';

// basic function that clones an array of objects (not deep)
const clone = (arr) => {
Expand Down
2 changes: 1 addition & 1 deletion showcase/app/routes/components/tabs.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import Route from '@ember/routing/route';

import { SIZES } from '@hashicorp/design-system-components/components/hds/tabs';
import { SIZES } from '@hashicorp/design-system-components/components/hds/tabs/index';

export default class ComponentsTabsRoute extends Route {
model() {
Expand Down
4 changes: 2 additions & 2 deletions showcase/app/routes/components/tag.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
*/

import Route from '@ember/routing/route';
import { COLORS } from '@hashicorp/design-system-components/components/hds/tag';
import { TOOLTIP_PLACEMENTS } from '@hashicorp/design-system-components/components/hds/tag';
import { COLORS } from '@hashicorp/design-system-components/components/hds/tag/index';
import { TOOLTIP_PLACEMENTS } from '@hashicorp/design-system-components/components/hds/tag/index';

export default class ComponentsTagRoute extends Route {
model() {
Expand Down
2 changes: 1 addition & 1 deletion showcase/app/routes/components/toast.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import Route from '@ember/routing/route';

// the "Toast" is built on top of the "Alert" so it shares the same colors
import { COLORS } from '@hashicorp/design-system-components/components/hds/alert';
import { COLORS } from '@hashicorp/design-system-components/components/hds/alert/index';

export default class ComponentsToastRoute extends Route {
model() {
Expand Down
2 changes: 1 addition & 1 deletion showcase/app/routes/components/tooltip.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import Route from '@ember/routing/route';

import { PLACEMENTS } from '@hashicorp/design-system-components/components/hds/tooltip-button';
import { PLACEMENTS } from '@hashicorp/design-system-components/components/hds/tooltip-button/index';

export default class ComponentsTooltipRoute extends Route {
model() {
Expand Down
2 changes: 1 addition & 1 deletion showcase/app/routes/layouts/flex.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
JUSTIFYS,
ALIGNS,
GAPS,
} from '@hashicorp/design-system-components/components/hds/layout/flex';
} from '@hashicorp/design-system-components/components/hds/layout/flex/index';

export default class LayoutsFlexRoute extends Route {
model() {
Expand Down
2 changes: 1 addition & 1 deletion showcase/app/routes/layouts/grid.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import Route from '@ember/routing/route';
import {
ALIGNS,
GAPS,
} from '@hashicorp/design-system-components/components/hds/layout/grid';
} from '@hashicorp/design-system-components/components/hds/layout/grid/index';

export default class LayoutsGridRoute extends Route {
model() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,59 +3,64 @@
* SPDX-License-Identifier: MPL-2.0
*/

import { module, skip } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';
import { render, resetOnerror, setupOnerror } from '@ember/test-helpers';
import { hbs } from 'ember-cli-htmlbars';

module('Integration | Component | hds/app-header/home-link', function (hooks) {
setupRenderingTest(hooks);

hooks.afterEach(() => {
resetOnerror();
});

skip('it should render the component with a CSS class that matches the component name', async function (assert) {
await render(
hbs`<Hds::AppHeader::HomeLink @icon="hashicorp" @ariaLabel="HashiCorp" id="test-home-link" />`
);
assert.dom('#test-home-link').hasClass('hds-app-header__home-link');
});

// CONTENT

skip('it renders the passed in args', async function (assert) {
await render(
hbs`<Hds::AppHeader::HomeLink @icon="hashicorp" @ariaLabel="HashiCorp" @href="https://www.hashicorp.com/" id="test-home-link" />`
);
assert.dom('.hds-icon-hashicorp').exists();
assert
.dom('#test-home-link')
.hasAttribute('href', 'https://www.hashicorp.com/')
.hasAttribute('aria-label', 'HashiCorp');
});

skip('it renders the logo with a custom passed in color', async function (assert) {
await render(
hbs`<Hds::AppHeader::HomeLink @icon="boundary" @ariaLabel="Boundary" @color="var(--token-color-boundary-brand)" @href="#" />`
);
assert
.dom('.hds-icon-boundary')
.hasAttribute('fill', 'var(--token-color-boundary-brand)');
});

// ASSERTIONS

skip('it should throw an assertion if @ariaLabel is missing/has no value', async function (assert) {
const errorMessage =
'@ariaLabel for "Hds::AppHeader::HomeLink" ("Logo") must have a valid value';
assert.expect(2);
setupOnerror(function (error) {
assert.strictEqual(error.message, `Assertion Failed: ${errorMessage}`);
});
await render(hbs`<Hds::AppHeader::HomeLink @icon="hashicorp" />`);
assert.throws(function () {
throw new Error(errorMessage);
});
});
});
// /**
// * Copyright (c) HashiCorp, Inc.
// * SPDX-License-Identifier: MPL-2.0
// */

// import { module, skip } from 'qunit';
// import { setupRenderingTest } from 'showcase/tests/helpers';
// import { render, resetOnerror, setupOnerror } from '@ember/test-helpers';
// import { hbs } from 'ember-cli-htmlbars';

// module('Integration | Component | hds/app-header/home-link', function (hooks) {
// setupRenderingTest(hooks);

// hooks.afterEach(() => {
// resetOnerror();
// });

// skip('it should render the component with a CSS class that matches the component name', async function (assert) {
// await render(
// hbs`<Hds::AppHeader::HomeLink @icon="hashicorp" @ariaLabel="HashiCorp" id="test-home-link" />`
// );
// assert.dom('#test-home-link').hasClass('hds-app-header__home-link');
// });

// // CONTENT

// skip('it renders the passed in args', async function (assert) {
// await render(
// hbs`<Hds::AppHeader::HomeLink @icon="hashicorp" @ariaLabel="HashiCorp" @href="https://www.hashicorp.com/" id="test-home-link" />`
// );
// assert.dom('.hds-icon-hashicorp').exists();
// assert
// .dom('#test-home-link')
// .hasAttribute('href', 'https://www.hashicorp.com/')
// .hasAttribute('aria-label', 'HashiCorp');
// });

// skip('it renders the logo with a custom passed in color', async function (assert) {
// await render(
// hbs`<Hds::AppHeader::HomeLink @icon="boundary" @ariaLabel="Boundary" @color="var(--token-color-boundary-brand)" @href="#" />`
// );
// assert
// .dom('.hds-icon-boundary')
// .hasAttribute('fill', 'var(--token-color-boundary-brand)');
// });

// // ASSERTIONS

// skip('it should throw an assertion if @ariaLabel is missing/has no value', async function (assert) {
// const errorMessage =
// '@ariaLabel for "Hds::AppHeader::HomeLink" ("Logo") must have a valid value';
// assert.expect(2);
// setupOnerror(function (error) {
// assert.strictEqual(error.message, `Assertion Failed: ${errorMessage}`);
// });
// await render(hbs`<Hds::AppHeader::HomeLink @icon="hashicorp" />`);
// assert.throws(function () {
// throw new Error(errorMessage);
// });
// });
// });
Loading