Skip to content

Commit

Permalink
Start item numbering from 1 instead of 0.
Browse files Browse the repository at this point in the history
Update unit and integration tests
Added playwright headed script for local use
  • Loading branch information
Dusan Mijatovic (Mac2023) committed Feb 6, 2024
1 parent 2699ae2 commit e56bf34
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion apps/haddock3-download/integration-tests/topoaamol.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ test.describe('given 1 molecule and a topoaa node with segment id defined', () =
await page.locator('input[type="text"]').fill('x')
// Upload e2a-hpr_1GGR.pdb
const file1 = await readFile('./integration-tests/data/e2a-hpr_1GGR.pdb')
await page.locator('text=0* >> input[type="file"]')
await page.locator('text=1* >> input[type="file"]')
.setInputFiles({ name: 'e2a-hpr_1GGR.pdb', mimeType: 'chemical/x-pdb', buffer: file1 })
// Click text=Save
await page.locator('button:has-text("Save")').click()
Expand Down
1 change: 1 addition & 0 deletions apps/haddock3-download/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"serve": "vite preview",
"lint": "ts-standard",
"test:integration": "playwright test",
"test:headed": "playwright test --project=chromium --headed",
"clean": "rm -rf .turbo && rm -rf node_modules && rm -rf dist"
},
"dependencies": {
Expand Down
6 changes: 3 additions & 3 deletions packages/form/src/table/TableField.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ describe('<TableField/>', () => {
expect(prop1th?.parentElement?.children).toHaveLength(3)
})

it.each(['0', '1', '2', '4', '5'])(
it.each(['1', '2', '3', '4', '5', '6'])(
'should have an index column with text %s',
(index) => {
const cell = screen.getByText(index)
Expand Down Expand Up @@ -132,7 +132,7 @@ describe('<TableField/>', () => {
expect(prop1th?.parentElement?.children).toHaveLength(3)
})

it.each(['0', '1', '2', '4', '5'])(
it.each(['1', '2', '3', '4', '5', '6'])(
'should have an index column with text %s',
(index) => {
const cell = screen.getByText(index)
Expand Down Expand Up @@ -162,7 +162,7 @@ describe('<TableField/>', () => {
expect(prop1th?.parentElement?.children).toHaveLength(3)
})

it.each(['a', 'b', 'c', '4', '5'])(
it.each(['a', 'b', 'c', '4', '5', '6'])(
'should have an index column with text %s',
(index) => {
const cell = screen.getByText(index)
Expand Down
4 changes: 2 additions & 2 deletions packages/form/src/useIndexable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export const useIndexable = (uiSchema: UiSchema): [boolean, (n: number) => strin
if (indexable &&
Array.isArray(uiOptions.indexable)) {
const lookup: string[] = uiOptions.indexable
return [indexable, (i: number) => i < lookup.length ? lookup[i] : `${i}`]
return [indexable, (i: number) => i < lookup.length ? lookup[i] : `${i + 1}`]
}
return [indexable, (i: number) => `${i}`]
return [indexable, (i: number) => `${i + 1}`]
}

0 comments on commit e56bf34

Please sign in to comment.