@estiva-app/ui 0.104.0 → 0.104.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@estiva-app/ui",
3
- "version": "0.104.0",
3
+ "version": "0.104.2",
4
4
  "description": "Estiva's design tokens (the contract) and a small set of primitives (a convenience) for every Estiva app.",
5
5
  "type": "module",
6
6
  "license": "MIT",
package/registry.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "kind": "package",
5
5
  "repo": "estiva-ui",
6
6
  "package": "@estiva-app/ui",
7
- "packageVersion": "0.104.0",
7
+ "packageVersion": "0.104.2",
8
8
  "exports": 245,
9
9
  "typeExports": 254,
10
10
  "files": null
@@ -71,4 +71,15 @@ describe('ResolveDialog', () => {
71
71
  render(<ResolveDialog onResolve={() => false} onCancel={() => {}} refused="The file is archived" />)
72
72
  expect(screen.getByText(/The file is archived/)).toBeTruthy()
73
73
  })
74
+
75
+ // Found in Leaf's adoption (3 November): the refusal marked the note invalid, and the form then sent nothing.
76
+ it('after a refusal, Resolve tries again, with the note as written', async () => {
77
+ const user = userEvent.setup()
78
+ const onResolve = vi.fn(() => false)
79
+ render(<ResolveDialog onResolve={onResolve} onCancel={() => {}} refused="The relay is busy. Try again." />)
80
+ await user.type(screen.getByRole('textbox'), 'Done')
81
+ await user.click(screen.getByRole('button', { name: 'Resolve' }))
82
+ await vi.waitFor(() => expect(onResolve).toHaveBeenCalledWith('Done'))
83
+ expect(screen.getByRole('alert').textContent).toBe('The relay is busy. Try again.')
84
+ })
74
85
  })
@@ -1,5 +1,5 @@
1
1
  import { useState } from 'react'
2
- import { Field } from './Field'
2
+ import { Field, FieldLine } from './Field'
3
3
  import { FormDialog } from './FormDialog'
4
4
  import { Textarea } from './Textarea'
5
5
 
@@ -22,8 +22,11 @@ export function ResolveDialog({ onResolve, onCancel, refused }: ResolveDialogPro
22
22
  return (
23
23
  // Outlined at rest and green on hover in Signal, the kit's `resolve` look.
24
24
  <FormDialog title="Resolve" submitLabel="Resolve" submitVariant="resolve" onSubmit={() => onResolve(note)} onClose={onCancel}>
25
- <Field label="Resolution message (optional)" error={refused}>
25
+ <Field label="Resolution message (optional)">
26
+ {/* The refusal in the error line's place, 6px under the note, without marking the note invalid: an invalid field
27
+ stops the form, and Resolve could not try again (found in Leaf's adoption, 3 November). */}
26
28
  <Textarea autoFocus value={note} onChange={(e) => setNote(e.target.value)} placeholder="Summarize the outcome or decision..." className="h-[109px]" />
29
+ {refused && <FieldLine tone="error">{refused}</FieldLine>}
27
30
  </Field>
28
31
  </FormDialog>
29
32
  )
@@ -3,7 +3,7 @@ import { mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from 'nod
3
3
  import { join } from 'node:path'
4
4
  import { pathToFileURL } from 'node:url'
5
5
  import { ESLint, type Linter } from 'eslint'
6
- import { afterAll, describe, expect, it } from 'vitest'
6
+ import { afterAll, beforeAll, describe, expect, it } from 'vitest'
7
7
  import { appChecks } from './app-checks'
8
8
  import { countCommitted, hookRuns, skippedFolders, skipsListed } from './ci'
9
9
  import { writeGateCount } from './count'
@@ -354,6 +354,18 @@ describe('runHook', () => {
354
354
  })
355
355
 
356
356
  describe('gates:status', () => {
357
+ // The made apps sit inside this repository, so status read it as theirs and fetched its origin, once or twice a test:
358
+ // on the release machine that took up to 20 s and the tests ran out of time (v0.104.1, 3 November). Git stops looking
359
+ // at `node_modules`, so an app is no repository unless a test makes it one.
360
+ const ceiling = process.env.GIT_CEILING_DIRECTORIES
361
+ beforeAll(() => {
362
+ process.env.GIT_CEILING_DIRECTORIES = join(root, 'node_modules')
363
+ })
364
+ afterAll(() => {
365
+ if (ceiling === undefined) delete process.env.GIT_CEILING_DIRECTORIES
366
+ else process.env.GIT_CEILING_DIRECTORIES = ceiling
367
+ })
368
+
357
369
  it('reads a CI job by its id, a committed hook, and a script', () => {
358
370
  const dir = app('status-helpers', {
359
371
  '.github/workflows/deploy.yml': 'jobs:\n check:\n steps:\n - run: npm test\n gate:\n steps:\n # - run: npm run lint:rules\n - run: npm run lint:rules\n',