From 610dbeda25f14a124c2b5e405430b29c3ccea27e Mon Sep 17 00:00:00 2001 From: mollykreis <20542556+mollykreis@users.noreply.github.com> Date: Thu, 21 Mar 2024 12:06:00 -0500 Subject: [PATCH] format + minor update --- .../tests/table-column-anchor-matrix.stories.ts | 5 ++++- .../anchor/tests/table-column-anchor.mdx | 2 +- .../anchor/tests/table-column-anchor.spec.ts | 5 ++++- .../base/tests/table-column-stories-utils.ts | 2 +- .../table-column-date-text-matrix.stories.ts | 5 ++++- .../tests/table-column-date-text.spec.ts | 17 ++++++++++------- ...table-column-duration-text-matrix.stories.ts | 5 ++++- .../tests/table-column-duration-text.spec.ts | 5 ++++- .../table-column-number-text-matrix.stories.ts | 5 ++++- .../tests/table-column-number-text.mdx | 5 ++++- .../tests/table-column-number-text.spec.ts | 5 ++++- .../tests/table-column-text-matrix.stories.ts | 5 ++++- .../text/tests/table-column-text.spec.ts | 5 ++++- 13 files changed, 52 insertions(+), 19 deletions(-) diff --git a/packages/nimble-components/src/table-column/anchor/tests/table-column-anchor-matrix.stories.ts b/packages/nimble-components/src/table-column/anchor/tests/table-column-anchor-matrix.stories.ts index f870e2a1ae..8b20f18351 100644 --- a/packages/nimble-components/src/table-column/anchor/tests/table-column-anchor-matrix.stories.ts +++ b/packages/nimble-components/src/table-column/anchor/tests/table-column-anchor-matrix.stories.ts @@ -14,7 +14,10 @@ import { controlLabelFont, controlLabelFontColor } from '../../../theme-provider/design-tokens'; -import { placeholderStates, type PlaceholderState } from '../../../utilities/tests/states'; +import { + placeholderStates, + type PlaceholderState +} from '../../../utilities/tests/states'; const metadata: Meta = { title: 'Tests/Table Column: Anchor', diff --git a/packages/nimble-components/src/table-column/anchor/tests/table-column-anchor.mdx b/packages/nimble-components/src/table-column/anchor/tests/table-column-anchor.mdx index 3b537c287f..e700335f32 100644 --- a/packages/nimble-components/src/table-column/anchor/tests/table-column-anchor.mdx +++ b/packages/nimble-components/src/table-column/anchor/tests/table-column-anchor.mdx @@ -20,7 +20,7 @@ The column is used to display string fields a - Do not provide `null`, `undefined`, empty, or whitespace labels with non-empty urls. - Do not provide duplicate labels for different urls. - If a label is not available or known for a url, the url itself may be explicitly provided for the label to ensure each distinct url has a distinct label. -- For records without a url, the label may also be omitted, but the omitted label should be consistent in using `null`, `undefined`, or empty string. +- For records without a url, the label may also be omitted. All omitted labels should consistently use `null`, `undefined`, or empty string but not a combination of those values. ### Target Configuration diff --git a/packages/nimble-components/src/table-column/anchor/tests/table-column-anchor.spec.ts b/packages/nimble-components/src/table-column/anchor/tests/table-column-anchor.spec.ts index 63503b5e3a..389d59a0d2 100644 --- a/packages/nimble-components/src/table-column/anchor/tests/table-column-anchor.spec.ts +++ b/packages/nimble-components/src/table-column/anchor/tests/table-column-anchor.spec.ts @@ -524,7 +524,10 @@ describe('TableColumnAnchor', () => { } ]; - async function initializeColumnAndTable(data: readonly SimpleTableRecord[], placeholder?: string): Promise { + async function initializeColumnAndTable( + data: readonly SimpleTableRecord[], + placeholder?: string + ): Promise { column.placeholder = placeholder; await table.setData(data); await connect(); diff --git a/packages/nimble-components/src/table-column/base/tests/table-column-stories-utils.ts b/packages/nimble-components/src/table-column/base/tests/table-column-stories-utils.ts index 84c6e6e7a5..9393acea93 100644 --- a/packages/nimble-components/src/table-column/base/tests/table-column-stories-utils.ts +++ b/packages/nimble-components/src/table-column/base/tests/table-column-stories-utils.ts @@ -53,4 +53,4 @@ export const sharedTableActions = [ export const columnOperationBehavior = 'Column operations, such as sorting and grouping, are performed on the field values in the data records, not on the formatted values displayed within the cells.'; -export const noNullAndUndefinedBestPractice = 'Avoid mixing `undefined` and `null` as values for the same field. When grouping this will lead to two groups (one for `null` values and one for `undefined` values) that both have the text `"No value"`.' +export const noNullAndUndefinedBestPractice = 'Avoid mixing `undefined` and `null` as values for the same field. When grouping this will lead to two groups (one for `null` values and one for `undefined` values) that both have the text `"No value"`.'; diff --git a/packages/nimble-components/src/table-column/date-text/tests/table-column-date-text-matrix.stories.ts b/packages/nimble-components/src/table-column/date-text/tests/table-column-date-text-matrix.stories.ts index 3d6c52c7ff..10107e30f5 100644 --- a/packages/nimble-components/src/table-column/date-text/tests/table-column-date-text-matrix.stories.ts +++ b/packages/nimble-components/src/table-column/date-text/tests/table-column-date-text-matrix.stories.ts @@ -12,7 +12,10 @@ import { controlLabelFont, controlLabelFontColor } from '../../../theme-provider/design-tokens'; -import { placeholderStates, type PlaceholderState } from '../../../utilities/tests/states'; +import { + placeholderStates, + type PlaceholderState +} from '../../../utilities/tests/states'; const metadata: Meta = { title: 'Tests/Table Column: Date Text', diff --git a/packages/nimble-components/src/table-column/date-text/tests/table-column-date-text.spec.ts b/packages/nimble-components/src/table-column/date-text/tests/table-column-date-text.spec.ts index aec236b804..f8f99c115b 100644 --- a/packages/nimble-components/src/table-column/date-text/tests/table-column-date-text.spec.ts +++ b/packages/nimble-components/src/table-column/date-text/tests/table-column-date-text.spec.ts @@ -563,7 +563,10 @@ describe('TableColumnDateText', () => { } ]; - async function initializeColumnAndTable(data: readonly SimpleTableRecord[], placeholder?: string): Promise { + async function initializeColumnAndTable( + data: readonly SimpleTableRecord[], + placeholder?: string + ): Promise { // Set a custom time zone so that the behavior of the test does not // depend on the configuration of the computer running the tests. column.format = DateTextFormat.custom; @@ -584,9 +587,9 @@ describe('TableColumnDateText', () => { const expectedCellText = value.usesColumnPlaceholder ? placeholder : value.cellValue; - expect( - pageObject.getRenderedCellContent(0, 0) - ).toBe(expectedCellText); + expect(pageObject.getRenderedCellContent(0, 0)).toBe( + expectedCellText + ); expect( pageObject.getRenderedGroupHeaderContent(0) ).toBe(value.groupValue); @@ -600,9 +603,9 @@ describe('TableColumnDateText', () => { async () => { await initializeColumnAndTable(value.data); - expect( - pageObject.getRenderedCellContent(0, 0) - ).toBe(value.cellValue); + expect(pageObject.getRenderedCellContent(0, 0)).toBe( + value.cellValue + ); expect( pageObject.getRenderedGroupHeaderContent(0) ).toBe(value.groupValue); diff --git a/packages/nimble-components/src/table-column/duration-text/tests/table-column-duration-text-matrix.stories.ts b/packages/nimble-components/src/table-column/duration-text/tests/table-column-duration-text-matrix.stories.ts index fd355befe0..71d0e29980 100644 --- a/packages/nimble-components/src/table-column/duration-text/tests/table-column-duration-text-matrix.stories.ts +++ b/packages/nimble-components/src/table-column/duration-text/tests/table-column-duration-text-matrix.stories.ts @@ -11,7 +11,10 @@ import { controlLabelFont, controlLabelFontColor } from '../../../theme-provider/design-tokens'; -import { placeholderStates, type PlaceholderState } from '../../../utilities/tests/states'; +import { + placeholderStates, + type PlaceholderState +} from '../../../utilities/tests/states'; const metadata: Meta = { title: 'Tests/Table Column: Duration Text', diff --git a/packages/nimble-components/src/table-column/duration-text/tests/table-column-duration-text.spec.ts b/packages/nimble-components/src/table-column/duration-text/tests/table-column-duration-text.spec.ts index a519fc8328..31e522e469 100644 --- a/packages/nimble-components/src/table-column/duration-text/tests/table-column-duration-text.spec.ts +++ b/packages/nimble-components/src/table-column/duration-text/tests/table-column-duration-text.spec.ts @@ -247,7 +247,10 @@ describe('TableColumnDurationText', () => { } ]; - async function initializeColumnAndTable(data: readonly SimpleTableRecord[], placeholder?: string): Promise { + async function initializeColumnAndTable( + data: readonly SimpleTableRecord[], + placeholder?: string + ): Promise { column.placeholder = placeholder; await table.setData(data); await connect(); diff --git a/packages/nimble-components/src/table-column/number-text/tests/table-column-number-text-matrix.stories.ts b/packages/nimble-components/src/table-column/number-text/tests/table-column-number-text-matrix.stories.ts index a5c7e08f55..42132e52da 100644 --- a/packages/nimble-components/src/table-column/number-text/tests/table-column-number-text-matrix.stories.ts +++ b/packages/nimble-components/src/table-column/number-text/tests/table-column-number-text-matrix.stories.ts @@ -13,7 +13,10 @@ import { controlLabelFontColor } from '../../../theme-provider/design-tokens'; import { NumberTextAlignment } from '../types'; -import { placeholderStates, type PlaceholderState } from '../../../utilities/tests/states'; +import { + placeholderStates, + type PlaceholderState +} from '../../../utilities/tests/states'; const metadata: Meta = { title: 'Tests/Table Column: Number Text', diff --git a/packages/nimble-components/src/table-column/number-text/tests/table-column-number-text.mdx b/packages/nimble-components/src/table-column/number-text/tests/table-column-number-text.mdx index 5ca9ed907f..a1a465edbc 100644 --- a/packages/nimble-components/src/table-column/number-text/tests/table-column-number-text.mdx +++ b/packages/nimble-components/src/table-column/number-text/tests/table-column-number-text.mdx @@ -1,6 +1,9 @@ import { Canvas, Meta, Controls, Title } from '@storybook/blocks'; import { NimbleTableColumnNumberText } from './table-column-number-text.react'; -import { columnOperationBehavior, noNullAndUndefinedBestPractice } from '../../base/tests/table-column-stories-utils'; +import { + columnOperationBehavior, + noNullAndUndefinedBestPractice +} from '../../base/tests/table-column-stories-utils'; import * as tableColumnNumberTextStories from './table-column-number-text.stories'; import { tableColumnNumberTextTag } from '..'; import { tableTag } from '../../../table'; diff --git a/packages/nimble-components/src/table-column/number-text/tests/table-column-number-text.spec.ts b/packages/nimble-components/src/table-column/number-text/tests/table-column-number-text.spec.ts index 1d9db3e9ac..515a3342af 100644 --- a/packages/nimble-components/src/table-column/number-text/tests/table-column-number-text.spec.ts +++ b/packages/nimble-components/src/table-column/number-text/tests/table-column-number-text.spec.ts @@ -768,7 +768,10 @@ describe('TableColumnNumberText', () => { } ]; - async function initializeColumnAndTable(data: readonly SimpleTableRecord[], placeholder?: string): Promise { + async function initializeColumnAndTable( + data: readonly SimpleTableRecord[], + placeholder?: string + ): Promise { elementReferences.column1.placeholder = placeholder; await table.setData(data); await connect(); diff --git a/packages/nimble-components/src/table-column/text/tests/table-column-text-matrix.stories.ts b/packages/nimble-components/src/table-column/text/tests/table-column-text-matrix.stories.ts index a8df411696..ea23c0f494 100644 --- a/packages/nimble-components/src/table-column/text/tests/table-column-text-matrix.stories.ts +++ b/packages/nimble-components/src/table-column/text/tests/table-column-text-matrix.stories.ts @@ -11,7 +11,10 @@ import { controlLabelFont, controlLabelFontColor } from '../../../theme-provider/design-tokens'; -import { placeholderStates, type PlaceholderState } from '../../../utilities/tests/states'; +import { + placeholderStates, + type PlaceholderState +} from '../../../utilities/tests/states'; const metadata: Meta = { title: 'Tests/Table Column: Text', diff --git a/packages/nimble-components/src/table-column/text/tests/table-column-text.spec.ts b/packages/nimble-components/src/table-column/text/tests/table-column-text.spec.ts index d0b0480fab..8d8458643c 100644 --- a/packages/nimble-components/src/table-column/text/tests/table-column-text.spec.ts +++ b/packages/nimble-components/src/table-column/text/tests/table-column-text.spec.ts @@ -259,7 +259,10 @@ describe('TableColumnText', () => { } ]; - async function initializeColumnAndTable(data: readonly SimpleTableRecord[], placeholder?: string): Promise { + async function initializeColumnAndTable( + data: readonly SimpleTableRecord[], + placeholder?: string + ): Promise { column.placeholder = placeholder; await table.setData(data); await connect();