@happyvertical/smrt-projects 0.53.0 → 0.53.3
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/README.md +19 -0
- package/dist/chunks/{Issue-Dwyg6-_O.js → Issue-DG5UNAGa.js} +6 -5
- package/dist/chunks/Issue-DG5UNAGa.js.map +1 -0
- package/dist/chunks/{PullRequest-D27EkBdR.js → PullRequest-CN7LpEl4.js} +2 -2
- package/dist/chunks/{PullRequest-D27EkBdR.js.map → PullRequest-CN7LpEl4.js.map} +1 -1
- package/dist/chunks/repository-client-scope-CAnWW7-r.js +50 -0
- package/dist/chunks/repository-client-scope-CAnWW7-r.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -6
- package/dist/index.js.map +1 -1
- package/dist/manifest.json +1 -1
- package/dist/models/Issue.d.ts.map +1 -1
- package/dist/models/Repository.d.ts.map +1 -1
- package/dist/repository-client-scope.d.ts +41 -0
- package/dist/repository-client-scope.d.ts.map +1 -0
- package/dist/smrt-knowledge.json +3 -3
- package/package.json +13 -13
- package/dist/chunks/Issue-Dwyg6-_O.js.map +0 -1
- package/dist/svelte/components/__tests__/ApprovalActions.test.js +0 -41
- package/dist/svelte/components/__tests__/BulkActions.test.js +0 -46
- package/dist/svelte/components/__tests__/DeliverySurfaces.test.js +0 -98
- package/dist/svelte/components/__tests__/DevelopmentRequest.test.js +0 -52
- package/dist/svelte/components/__tests__/ProjectBoard.test.js +0 -156
- package/dist/svelte/components/__tests__/RejectDialog.test.js +0 -45
- package/dist/svelte/components/__tests__/TimesheetsReexports.test.js +0 -18
- package/dist/svelte/utils.test.js +0 -44
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
// @vitest-environment jsdom
|
|
2
|
-
/**
|
|
3
|
-
* Component coverage for RejectDialog via the shared S11 harness (#1416).
|
|
4
|
-
*/
|
|
5
|
-
import { expectNoA11yViolations, render, screen, userEvent, } from '@happyvertical/smrt-vitest/svelte';
|
|
6
|
-
import { describe, expect, it, vi } from 'vitest';
|
|
7
|
-
import RejectDialog from '../RejectDialog.svelte';
|
|
8
|
-
const baseProps = (over = {}) => ({
|
|
9
|
-
open: true,
|
|
10
|
-
onconfirm: vi.fn(),
|
|
11
|
-
oncancel: vi.fn(),
|
|
12
|
-
...over,
|
|
13
|
-
});
|
|
14
|
-
describe('RejectDialog', () => {
|
|
15
|
-
it('renders the dialog with a reason field when open', () => {
|
|
16
|
-
render(RejectDialog, { props: baseProps() });
|
|
17
|
-
expect(screen.getByRole('dialog')).toBeInTheDocument();
|
|
18
|
-
expect(screen.getByRole('textbox')).toBeInTheDocument();
|
|
19
|
-
expect(screen.getByRole('button', { name: 'Reject' })).toBeInTheDocument();
|
|
20
|
-
});
|
|
21
|
-
it('renders nothing when closed', () => {
|
|
22
|
-
render(RejectDialog, { props: baseProps({ open: false }) });
|
|
23
|
-
expect(screen.queryByRole('dialog')).toBeNull();
|
|
24
|
-
});
|
|
25
|
-
it('requires a reason before the confirm button is enabled', async () => {
|
|
26
|
-
const onconfirm = vi.fn();
|
|
27
|
-
render(RejectDialog, { props: baseProps({ onconfirm }) });
|
|
28
|
-
const confirm = screen.getByRole('button', { name: 'Reject' });
|
|
29
|
-
expect(confirm).toBeDisabled();
|
|
30
|
-
await userEvent.type(screen.getByRole('textbox'), 'Insufficient detail');
|
|
31
|
-
expect(confirm).toBeEnabled();
|
|
32
|
-
await userEvent.click(confirm);
|
|
33
|
-
expect(onconfirm).toHaveBeenCalledWith('Insufficient detail');
|
|
34
|
-
});
|
|
35
|
-
it('cancels via the cancel button', async () => {
|
|
36
|
-
const oncancel = vi.fn();
|
|
37
|
-
render(RejectDialog, { props: baseProps({ oncancel }) });
|
|
38
|
-
await userEvent.click(screen.getByRole('button', { name: 'Cancel' }));
|
|
39
|
-
expect(oncancel).toHaveBeenCalledTimes(1);
|
|
40
|
-
});
|
|
41
|
-
it('is axe-clean', async () => {
|
|
42
|
-
const { container } = render(RejectDialog, { props: baseProps() });
|
|
43
|
-
await expectNoA11yViolations(container);
|
|
44
|
-
});
|
|
45
|
-
});
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
// @vitest-environment jsdom
|
|
2
|
-
/**
|
|
3
|
-
* #3288: the time-entry components moved to smrt-timesheets and stay
|
|
4
|
-
* importable from `@happyvertical/smrt-projects/svelte` under the same names.
|
|
5
|
-
*/
|
|
6
|
-
import * as timesheets from '@happyvertical/smrt-timesheets/svelte';
|
|
7
|
-
import { describe, expect, it } from 'vitest';
|
|
8
|
-
import * as projects from '../../index.js';
|
|
9
|
-
describe('smrt-projects/svelte time-entry re-exports', () => {
|
|
10
|
-
it('re-exports the moved components and helpers unchanged', () => {
|
|
11
|
-
expect(projects.TimeEntryList).toBe(timesheets.TimeEntryList);
|
|
12
|
-
expect(projects.TimeEntryCard).toBe(timesheets.TimeEntryCard);
|
|
13
|
-
expect(projects.TimeSummary).toBe(timesheets.TimeSummary);
|
|
14
|
-
expect(projects.DurationDisplay).toBe(timesheets.DurationDisplay);
|
|
15
|
-
expect(projects.formatCurrency).toBe(timesheets.formatCurrency);
|
|
16
|
-
expect(projects.formatHoursHHMM).toBe(timesheets.formatHoursHHMM);
|
|
17
|
-
});
|
|
18
|
-
});
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Currency formatting for integer minor units (#2401).
|
|
3
|
-
*
|
|
4
|
-
* `formatCurrency` receives what the database stores — integer minor units —
|
|
5
|
-
* and `Intl.NumberFormat` formats major units, so the scale has to be undone
|
|
6
|
-
* first. Which scale depends on the currency, which is the trap this file
|
|
7
|
-
* guards: a hard-coded `/100`, or a `minimumFractionDigits: 2` override that
|
|
8
|
-
* pins the resolved exponent to 2, both mis-render every currency that does not
|
|
9
|
-
* have exactly two decimal places.
|
|
10
|
-
*/
|
|
11
|
-
import { formatCurrency as formatCurrencyFromComponents } from '@happyvertical/smrt-timesheets/svelte';
|
|
12
|
-
import { describe, expect, it } from 'vitest';
|
|
13
|
-
import { formatCurrency } from './utils.js';
|
|
14
|
-
describe('formatCurrency (#2401)', () => {
|
|
15
|
-
it('renders a two-decimal currency by undoing the cent scale', () => {
|
|
16
|
-
// 19999 minor units is $199.99, not $19,999.00.
|
|
17
|
-
expect(formatCurrency(19999, 'CAD')).toContain('199.99');
|
|
18
|
-
expect(formatCurrency(19999, 'CAD')).not.toContain('19,999');
|
|
19
|
-
});
|
|
20
|
-
it('renders zero as the currency zero rather than nothing', () => {
|
|
21
|
-
expect(formatCurrency(0, 'CAD')).toContain('0.00');
|
|
22
|
-
});
|
|
23
|
-
it('does not rescale or add decimals to a zero-decimal currency', () => {
|
|
24
|
-
// JPY has no minor unit, so 1999 is ¥1,999 — dividing by 100 here would
|
|
25
|
-
// report ¥19.99, a hundredfold understatement, and printing two decimals
|
|
26
|
-
// would invent a fractional part the currency does not have.
|
|
27
|
-
const formatted = formatCurrency(1999, 'JPY');
|
|
28
|
-
expect(formatted).toContain('1,999');
|
|
29
|
-
expect(formatted).not.toContain('1,999.00');
|
|
30
|
-
});
|
|
31
|
-
it('uses a three-decimal currency exponent for a three-decimal currency', () => {
|
|
32
|
-
// BHD is 1000 fils to the dinar, so 1999 fils is BHD 1.999.
|
|
33
|
-
expect(formatCurrency(1999, 'BHD')).toContain('1.999');
|
|
34
|
-
});
|
|
35
|
-
it('is duplicated verbatim under components/, so both copies must agree', () => {
|
|
36
|
-
for (const [amount, currency] of [
|
|
37
|
-
[19999, 'CAD'],
|
|
38
|
-
[1999, 'JPY'],
|
|
39
|
-
[0, 'USD'],
|
|
40
|
-
]) {
|
|
41
|
-
expect(formatCurrencyFromComponents(amount, currency)).toBe(formatCurrency(amount, currency));
|
|
42
|
-
}
|
|
43
|
-
});
|
|
44
|
-
});
|