Skip to content
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

Start item number from 1 instead of 0 #136

Merged
merged 1 commit into from
Feb 8, 2024
Merged
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 README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,10 @@ Tests can be run with
yarn test:integration
```

To run in a non-headless browser use
To run a non-headless chromium browser use

```shell
yarn test:integration --headed
yarn test:headed
```

The browser will pause when a test calls `await page.pause()`, so you can investigate current state.
Expand Down
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",
dmijatovic marked this conversation as resolved.
Show resolved Hide resolved
"clean": "rm -rf .turbo && rm -rf node_modules && rm -rf dist"
},
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion docs/uiSchema.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ For example
}
```

The fourth array item will get index `3` as the lookup array only resolves the first 3 array items.
The fourth array item will get index `4` as the lookup array only resolves the first 3 array items.

### Molecule filename as index

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}`]
}
Loading