@bevel-software/platform-core-frontend 0.20.0 → 0.22.0
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 +2 -2
- package/src/core/registry.ts +57 -0
- package/src/modules/access/__tests__/ManageAccessDialog.request.test.tsx +376 -0
- package/src/modules/access/components/AccessRequestControl.tsx +155 -0
- package/src/modules/{library → access}/components/AccessRequestsBanner.tsx +62 -24
- package/src/modules/access/components/ManageAccessDialog.tsx +81 -4
- package/src/modules/access/hooks/useAccessRequests.ts +183 -0
- package/src/modules/access/hooks/useFileAccess.ts +2 -2
- package/src/modules/access/requests.api.ts +121 -0
- package/src/modules/auth/components/LoginScreen.tsx +6 -0
- package/src/modules/change-requests/__tests__/ChangeRequestDialog.brings-itself-up-to-date.test.tsx +171 -38
- package/src/modules/change-requests/__tests__/ChangeRequestDialog.fork-point.test.tsx +34 -19
- package/src/modules/change-requests/__tests__/ChangeRequestDialog.test.tsx +173 -6
- package/src/modules/change-requests/components/ChangeRequestDialog.tsx +155 -98
- package/src/modules/git/components/BranchSwitcher.tsx +9 -3
- package/src/modules/git/components/FileComparisonPanel.tsx +10 -4
- package/src/modules/git/components/PullNeededBanner.tsx +2 -2
- package/src/modules/git/services/error-messages.ts +2 -2
- package/src/modules/layout/__tests__/HeaderAlignment.test.tsx +110 -9
- package/src/modules/layout/components/SidebarFrame.tsx +26 -9
- package/src/modules/library/__tests__/DeleteToolDialog.test.tsx +11 -0
- package/src/modules/library/__tests__/LibraryRoutes.test.tsx +3 -0
- package/src/modules/library/__tests__/PluginIndexRow.test.tsx +146 -0
- package/src/modules/library/__tests__/PluginPage.test.tsx +110 -3
- package/src/modules/library/__tests__/SkillPage.test.tsx +15 -0
- package/src/modules/library/__tests__/ToolPage.test.tsx +34 -0
- package/src/modules/library/__tests__/name-with-badges.test.tsx +16 -3
- package/src/modules/library/__tests__/title-row-actions.ts +95 -0
- package/src/modules/library/components/PluginIndexRow.tsx +37 -20
- package/src/modules/library/components/PluginJoinRequests.tsx +2 -2
- package/src/modules/library/components/PluginPage.tsx +115 -3
- package/src/modules/library/components/skill-page/SkillPage.tsx +2 -2
- package/src/modules/library/components/tool-page/ToolPage.tsx +36 -18
- package/src/modules/library/hooks/useJoinRequests.ts +26 -101
- package/src/modules/library/routes/library-paths.ts +9 -2
- package/src/modules/library/services/plugins.api.ts +45 -0
- package/src/modules/library/utils/plugin-summary.ts +7 -2
- package/src/modules/onboarding/__tests__/onboarding.test.tsx +43 -0
- package/src/modules/onboarding/components/ConnectAgentPill.tsx +13 -2
- package/src/modules/pr/components/OpenChangeRequestDialog.tsx +3 -2
- package/src/modules/pr/services/pr-merge.api.ts +10 -2
- package/src/modules/review/components/ReviewPanel.tsx +2 -2
- package/src/modules/settings/components/DeploymentPage.tsx +22 -0
- package/src/modules/settings/components/__tests__/DeploymentPage.test.tsx +72 -4
- package/src/modules/setup/__tests__/setup.first-run.test.tsx +276 -0
- package/src/modules/setup/__tests__/setup.github.test.tsx +416 -0
- package/src/modules/setup/__tests__/setup.kept-draft.test.tsx +275 -0
- package/src/modules/setup/__tests__/setup.repository.test.tsx +373 -0
- package/src/modules/setup/__tests__/setup.test.tsx +8 -14
- package/src/modules/setup/components/GitHubRepositoryPanel.tsx +369 -0
- package/src/modules/setup/components/SetupGate.tsx +1 -0
- package/src/modules/setup/components/SetupScreen.tsx +464 -38
- package/src/modules/setup/services/setup.api.ts +93 -0
- package/src/modules/setup/utils/kept-draft.ts +86 -0
- package/src/modules/workspace/components/FileExplorer.tsx +4 -2
- package/src/modules/workspace/components/FileViewer.tsx +8 -3
- package/src/modules/workspace/components/KbDocumentShell.tsx +50 -8
- package/src/modules/workspace/components/__tests__/FileViewer.test.tsx +49 -0
- package/src/modules/workspace/components/__tests__/KbDocumentShell.test.tsx +49 -1
- package/src/modules/workspace/hooks/useWorkspaceState.ts +7 -2
- package/src/modules/workspace/utils/fileTree.ts +2 -1
- package/src/modules/workspace/utils/treeConfirm.ts +7 -3
- package/src/shared/components/SlotBoundary.tsx +51 -0
- package/src/shared/theme/measure.ts +23 -2
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';
|
|
2
|
+
import { cleanup, render, screen, waitFor } from '@testing-library/react';
|
|
3
|
+
import userEvent from '@testing-library/user-event';
|
|
4
|
+
|
|
5
|
+
const api = vi.hoisted(() => ({
|
|
6
|
+
fetchSetupStatus: vi.fn(),
|
|
7
|
+
saveSettings: vi.fn(),
|
|
8
|
+
testConnection: vi.fn(),
|
|
9
|
+
testOidc: vi.fn(),
|
|
10
|
+
syncNow: vi.fn(),
|
|
11
|
+
fetchGitHubApp: vi.fn(),
|
|
12
|
+
fetchGitHubRepositories: vi.fn(),
|
|
13
|
+
startGitHubAppRegistration: vi.fn(),
|
|
14
|
+
startGitHubAppInstallation: vi.fn(),
|
|
15
|
+
startGitHubAppRefresh: vi.fn(),
|
|
16
|
+
}));
|
|
17
|
+
vi.mock('../services/setup.api', async () => {
|
|
18
|
+
const actual = await vi.importActual<typeof import('../services/setup.api')>('../services/setup.api');
|
|
19
|
+
return { ...actual, ...api };
|
|
20
|
+
});
|
|
21
|
+
vi.mock('../../settings/services/github-facade.api', () => ({
|
|
22
|
+
fetchGitHubFacade: vi.fn(),
|
|
23
|
+
rotateGitHubFacade: vi.fn(),
|
|
24
|
+
fetchMarketplaceRegistration: vi.fn(async () => false),
|
|
25
|
+
setMarketplaceRegistration: vi.fn(),
|
|
26
|
+
}));
|
|
27
|
+
|
|
28
|
+
import { SetupScreen } from '../components/SetupScreen';
|
|
29
|
+
import type { GitHubAppStatus, GitMode, SettingStatus } from '../services/setup.api';
|
|
30
|
+
import { forgetDraft, keepDraft, keptDraft } from '../utils/kept-draft';
|
|
31
|
+
|
|
32
|
+
const setting = (key: string, section: SettingStatus['section'], extra: Partial<SettingStatus> = {}): SettingStatus => ({
|
|
33
|
+
key,
|
|
34
|
+
section,
|
|
35
|
+
source: 'unset',
|
|
36
|
+
value: '',
|
|
37
|
+
configured: false,
|
|
38
|
+
secret: false,
|
|
39
|
+
restartToApply: false,
|
|
40
|
+
...extra,
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
const SETTINGS: SettingStatus[] = [
|
|
44
|
+
setting('gitMode', 'knowledge-base'),
|
|
45
|
+
setting('githubRepository', 'knowledge-base'),
|
|
46
|
+
setting('kbRepoUrl', 'knowledge-base'),
|
|
47
|
+
setting('gitToken', 'knowledge-base', { secret: true, value: undefined }),
|
|
48
|
+
setting('knowledgeBaseDir', 'knowledge-base', { restartToApply: true }),
|
|
49
|
+
setting('defaultBranch', 'knowledge-base'),
|
|
50
|
+
setting('protectedBranches', 'knowledge-base'),
|
|
51
|
+
setting('oidcIssuerUrl', 'sign-in'),
|
|
52
|
+
setting('oidcClientId', 'sign-in'),
|
|
53
|
+
setting('oidcClientSecret', 'sign-in', { secret: true, value: undefined }),
|
|
54
|
+
];
|
|
55
|
+
const MODES: GitMode[] = ['managed', 'github-app', 'token'];
|
|
56
|
+
const APP = { slug: 'hexis-acme', url: 'https://github.com/apps/hexis-acme' };
|
|
57
|
+
const NO_APP: GitHubAppStatus = { registeredBy: null, app: null, installation: null, repository: null };
|
|
58
|
+
const REGISTERED: GitHubAppStatus = { registeredBy: 'setup', app: APP, installation: null, repository: null };
|
|
59
|
+
const INSTALLED: GitHubAppStatus = { ...REGISTERED, installation: { id: '77', account: 'acme' } };
|
|
60
|
+
|
|
61
|
+
const realLocation = window.location;
|
|
62
|
+
const assign = vi.fn();
|
|
63
|
+
function standAt(search = '') {
|
|
64
|
+
Object.defineProperty(window, 'location', {
|
|
65
|
+
configurable: true,
|
|
66
|
+
value: { ...realLocation, href: `https://kb.acme.test/${search}`, search, origin: 'https://kb.acme.test', reload: vi.fn(), assign },
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
const show = (settings: SettingStatus[] = SETTINGS) =>
|
|
71
|
+
render(<SetupScreen settings={settings} onSaved={() => {}} repository={{ mode: null, chosen: null, modes: MODES }} />);
|
|
72
|
+
const field = (label: string) => screen.getByLabelText(label, { exact: false }) as HTMLInputElement;
|
|
73
|
+
const isSecret = (key: string) => SETTINGS.find((s) => s.key === key)?.secret !== false;
|
|
74
|
+
|
|
75
|
+
/** Fill the form the way someone might before turning to GitHub, then press the button that leaves. */
|
|
76
|
+
async function typeThenLeave(press: string) {
|
|
77
|
+
await userEvent.type(field('Knowledge folder'), 'Docs');
|
|
78
|
+
await userEvent.type(field('Provider address'), 'https://login.example.com');
|
|
79
|
+
await userEvent.type(field('Application ID'), 'an-app');
|
|
80
|
+
await userEvent.type(field('Application secret'), 'a-secret-nobody-should-store');
|
|
81
|
+
await userEvent.click(screen.getByRole('tab', { name: 'Address and token' }));
|
|
82
|
+
await userEvent.type(field('Repository address'), 'https://git.example.com/acme/kb.git');
|
|
83
|
+
await userEvent.type(field('Access token'), 'a-token-nobody-should-store');
|
|
84
|
+
await userEvent.click(screen.getByRole('tab', { name: 'GitHub' }));
|
|
85
|
+
await userEvent.click(await screen.findByRole('button', { name: press }));
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/** The page that comes back from GitHub: a new one, in the same tab. */
|
|
89
|
+
function comeBack(outcome = 'connected') {
|
|
90
|
+
cleanup();
|
|
91
|
+
standAt(`?github=${outcome}`);
|
|
92
|
+
return show();
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
let submit: ReturnType<typeof vi.spyOn>;
|
|
96
|
+
let replace: ReturnType<typeof vi.spyOn>;
|
|
97
|
+
|
|
98
|
+
beforeEach(() => {
|
|
99
|
+
for (const fn of Object.values(api)) fn.mockReset();
|
|
100
|
+
assign.mockReset();
|
|
101
|
+
sessionStorage.clear();
|
|
102
|
+
api.fetchGitHubApp.mockResolvedValue(NO_APP);
|
|
103
|
+
api.fetchGitHubRepositories.mockResolvedValue({ repositories: [], more: false });
|
|
104
|
+
api.startGitHubAppRegistration.mockResolvedValue({ action: 'https://github.com/settings/apps/new?state=abc', manifest: {} });
|
|
105
|
+
api.startGitHubAppInstallation.mockResolvedValue('https://github.com/apps/hexis-acme/installations/new?state=abc');
|
|
106
|
+
submit = vi.spyOn(HTMLFormElement.prototype, 'submit').mockImplementation(() => undefined);
|
|
107
|
+
replace = vi.spyOn(window.history, 'replaceState').mockImplementation(() => undefined);
|
|
108
|
+
standAt();
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
afterEach(() => {
|
|
112
|
+
submit.mockRestore();
|
|
113
|
+
replace.mockRestore();
|
|
114
|
+
Object.defineProperty(window, 'location', { configurable: true, value: realLocation });
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
describe('what was typed, across the trip to GitHub', () => {
|
|
118
|
+
it('is there again when the browser comes back from creating the app', async () => {
|
|
119
|
+
show();
|
|
120
|
+
await typeThenLeave('Create the GitHub App');
|
|
121
|
+
await waitFor(() => expect(submit).toHaveBeenCalled());
|
|
122
|
+
|
|
123
|
+
api.fetchGitHubApp.mockResolvedValue(REGISTERED);
|
|
124
|
+
comeBack();
|
|
125
|
+
expect(field('Knowledge folder')).toHaveValue('Docs');
|
|
126
|
+
// What was being typed about sign-in is shown, on the tab it was typed on.
|
|
127
|
+
expect(field('Provider address')).toHaveValue('https://login.example.com');
|
|
128
|
+
expect(field('Application ID')).toHaveValue('an-app');
|
|
129
|
+
await userEvent.click(screen.getByRole('tab', { name: 'Address and token' }));
|
|
130
|
+
expect(field('Repository address')).toHaveValue('https://git.example.com/acme/kb.git');
|
|
131
|
+
});
|
|
132
|
+
|
|
133
|
+
it('is there again after the second trip too, to install the app', async () => {
|
|
134
|
+
api.fetchGitHubApp.mockResolvedValue(REGISTERED);
|
|
135
|
+
show();
|
|
136
|
+
await typeThenLeave('Install the app on GitHub');
|
|
137
|
+
await waitFor(() => expect(assign).toHaveBeenCalled());
|
|
138
|
+
|
|
139
|
+
api.fetchGitHubApp.mockResolvedValue(INSTALLED);
|
|
140
|
+
comeBack();
|
|
141
|
+
expect(field('Knowledge folder')).toHaveValue('Docs');
|
|
142
|
+
expect(field('Provider address')).toHaveValue('https://login.example.com');
|
|
143
|
+
});
|
|
144
|
+
|
|
145
|
+
it('is what the form held when the browser left, not when the button was pressed', async () => {
|
|
146
|
+
let answer: (address: string) => void = () => undefined;
|
|
147
|
+
api.fetchGitHubApp.mockResolvedValue(REGISTERED);
|
|
148
|
+
api.startGitHubAppInstallation.mockReturnValue(new Promise<string>((resolve) => (answer = resolve)));
|
|
149
|
+
show();
|
|
150
|
+
await userEvent.click(screen.getByRole('tab', { name: 'GitHub' }));
|
|
151
|
+
await userEvent.click(await screen.findByRole('button', { name: 'Install the app on GitHub' }));
|
|
152
|
+
// Typed while GitHub was being asked where to go.
|
|
153
|
+
await userEvent.type(field('Knowledge folder'), 'Docs');
|
|
154
|
+
answer('https://github.com/apps/hexis-acme/installations/new?state=abc');
|
|
155
|
+
await waitFor(() => expect(assign).toHaveBeenCalled());
|
|
156
|
+
|
|
157
|
+
comeBack();
|
|
158
|
+
expect(field('Knowledge folder')).toHaveValue('Docs');
|
|
159
|
+
});
|
|
160
|
+
|
|
161
|
+
it('is saved with everything else, like anything typed', async () => {
|
|
162
|
+
api.saveSettings.mockResolvedValue({ restartRequired: false, complete: false, settings: SETTINGS, repository: { mode: null, chosen: null, modes: MODES } });
|
|
163
|
+
show();
|
|
164
|
+
await typeThenLeave('Create the GitHub App');
|
|
165
|
+
comeBack();
|
|
166
|
+
await userEvent.click(screen.getByRole('tab', { name: 'Managed for you' }));
|
|
167
|
+
await userEvent.click(screen.getByRole('button', { name: 'Save and continue' }));
|
|
168
|
+
await waitFor(() => expect(api.saveSettings).toHaveBeenCalled());
|
|
169
|
+
expect(api.saveSettings.mock.calls[0]![0]).toEqual({
|
|
170
|
+
gitMode: 'managed',
|
|
171
|
+
knowledgeBaseDir: 'Docs',
|
|
172
|
+
oidcIssuerUrl: 'https://login.example.com',
|
|
173
|
+
oidcClientId: 'an-app',
|
|
174
|
+
});
|
|
175
|
+
});
|
|
176
|
+
});
|
|
177
|
+
|
|
178
|
+
describe('a secret, across the trip to GitHub', () => {
|
|
179
|
+
it('is never written to the browser storage', async () => {
|
|
180
|
+
show();
|
|
181
|
+
await typeThenLeave('Create the GitHub App');
|
|
182
|
+
await waitFor(() => expect(submit).toHaveBeenCalled());
|
|
183
|
+
const stored = Object.keys(sessionStorage).map((key) => sessionStorage.getItem(key) ?? '').join('\n');
|
|
184
|
+
expect(stored).toContain('Docs');
|
|
185
|
+
expect(stored).not.toContain('a-secret-nobody-should-store');
|
|
186
|
+
expect(stored).not.toContain('a-token-nobody-should-store');
|
|
187
|
+
});
|
|
188
|
+
|
|
189
|
+
it('comes back empty, and the screen says which to enter again', async () => {
|
|
190
|
+
show();
|
|
191
|
+
await typeThenLeave('Create the GitHub App');
|
|
192
|
+
comeBack();
|
|
193
|
+
expect(field('Application secret')).toHaveValue('');
|
|
194
|
+
const notice = screen.getByTestId('enter-again');
|
|
195
|
+
expect(notice).toHaveTextContent('What you had entered is back, except');
|
|
196
|
+
expect(notice).toHaveTextContent('Application secret');
|
|
197
|
+
expect(notice).toHaveTextContent('Access token');
|
|
198
|
+
expect(notice).toHaveTextContent('enter them again');
|
|
199
|
+
});
|
|
200
|
+
|
|
201
|
+
it('stops being asked for as each is entered again', async () => {
|
|
202
|
+
show();
|
|
203
|
+
await typeThenLeave('Create the GitHub App');
|
|
204
|
+
comeBack();
|
|
205
|
+
await userEvent.type(field('Application secret'), 'typed-again');
|
|
206
|
+
expect(screen.getByTestId('enter-again')).not.toHaveTextContent('Application secret');
|
|
207
|
+
expect(screen.getByTestId('enter-again')).toHaveTextContent('enter it again');
|
|
208
|
+
await userEvent.click(screen.getByRole('tab', { name: 'Address and token' }));
|
|
209
|
+
await userEvent.type(field('Access token'), 'typed-again');
|
|
210
|
+
expect(screen.queryByTestId('enter-again')).toBeNull();
|
|
211
|
+
});
|
|
212
|
+
|
|
213
|
+
it('is not given back even if the storage was made to hold one', () => {
|
|
214
|
+
sessionStorage.setItem('hexis_setup_draft', JSON.stringify({ draft: { gitToken: 'planted', knowledgeBaseDir: 'Docs' }, dropped: [], at: Date.now() }));
|
|
215
|
+
expect(keptDraft(isSecret).draft).toEqual({ knowledgeBaseDir: 'Docs' });
|
|
216
|
+
// A setting the form has never heard of is treated as one.
|
|
217
|
+
expect(keptDraft(isSecret).draft).not.toHaveProperty('somethingElse');
|
|
218
|
+
});
|
|
219
|
+
});
|
|
220
|
+
|
|
221
|
+
describe('what is kept, and for how long', () => {
|
|
222
|
+
it('is given back once: a reload of the page that came back starts from what is stored', async () => {
|
|
223
|
+
show();
|
|
224
|
+
await typeThenLeave('Create the GitHub App');
|
|
225
|
+
comeBack();
|
|
226
|
+
expect(field('Knowledge folder')).toHaveValue('Docs');
|
|
227
|
+
expect(sessionStorage.getItem('hexis_setup_draft')).toBeNull();
|
|
228
|
+
comeBack();
|
|
229
|
+
expect(field('Knowledge folder')).toHaveValue('');
|
|
230
|
+
});
|
|
231
|
+
|
|
232
|
+
it('is not sprung on someone who opens the screen without coming back from GitHub', async () => {
|
|
233
|
+
show();
|
|
234
|
+
await typeThenLeave('Create the GitHub App');
|
|
235
|
+
// The trip was abandoned; the screen is opened again later, in the same tab.
|
|
236
|
+
cleanup();
|
|
237
|
+
standAt();
|
|
238
|
+
show();
|
|
239
|
+
expect(field('Knowledge folder')).toHaveValue('');
|
|
240
|
+
expect(screen.queryByTestId('enter-again')).toBeNull();
|
|
241
|
+
// And it is gone, so a later return from GitHub does not find it either.
|
|
242
|
+
expect(sessionStorage.getItem('hexis_setup_draft')).toBeNull();
|
|
243
|
+
});
|
|
244
|
+
|
|
245
|
+
it('is good for half an hour', () => {
|
|
246
|
+
const left = Date.parse('2026-09-29T10:00:00Z');
|
|
247
|
+
keepDraft({ knowledgeBaseDir: 'Docs' }, isSecret, left);
|
|
248
|
+
expect(keptDraft(isSecret, left + 29 * 60_000).draft).toEqual({ knowledgeBaseDir: 'Docs' });
|
|
249
|
+
expect(keptDraft(isSecret, left + 31 * 60_000).draft).toEqual({});
|
|
250
|
+
});
|
|
251
|
+
|
|
252
|
+
it('keeps nothing when nothing was typed', () => {
|
|
253
|
+
keepDraft({ knowledgeBaseDir: ' ', gitMode: '' }, isSecret);
|
|
254
|
+
expect(sessionStorage.getItem('hexis_setup_draft')).toBeNull();
|
|
255
|
+
});
|
|
256
|
+
|
|
257
|
+
it('gives back nothing for a setting the environment has taken over meanwhile', async () => {
|
|
258
|
+
show();
|
|
259
|
+
await typeThenLeave('Create the GitHub App');
|
|
260
|
+
cleanup();
|
|
261
|
+
standAt('?github=connected');
|
|
262
|
+
show(SETTINGS.map((s) => (s.key === 'knowledgeBaseDir' ? { ...s, source: 'env', envVar: 'KB_KNOWLEDGE_BASE_DIR' } : s)));
|
|
263
|
+
expect(screen.queryByLabelText('Knowledge folder', { exact: false })).toBeNull();
|
|
264
|
+
expect(field('Provider address')).toHaveValue('https://login.example.com');
|
|
265
|
+
});
|
|
266
|
+
|
|
267
|
+
it('reads storage that holds something else as nothing kept', () => {
|
|
268
|
+
for (const junk of ['not json', '{"draft":"no"}', '{"at":"yesterday","draft":{}}', '[]', 'null']) {
|
|
269
|
+
sessionStorage.setItem('hexis_setup_draft', junk);
|
|
270
|
+
expect(keptDraft(isSecret), junk).toEqual({ draft: {}, dropped: [] });
|
|
271
|
+
}
|
|
272
|
+
forgetDraft();
|
|
273
|
+
expect(sessionStorage.getItem('hexis_setup_draft')).toBeNull();
|
|
274
|
+
});
|
|
275
|
+
});
|
|
@@ -0,0 +1,373 @@
|
|
|
1
|
+
import { describe, it, expect, vi, beforeEach } from 'vitest';
|
|
2
|
+
import { render, screen, waitFor, within } from '@testing-library/react';
|
|
3
|
+
import userEvent from '@testing-library/user-event';
|
|
4
|
+
|
|
5
|
+
const api = vi.hoisted(() => ({
|
|
6
|
+
fetchSetupStatus: vi.fn(),
|
|
7
|
+
saveSettings: vi.fn(),
|
|
8
|
+
testConnection: vi.fn(),
|
|
9
|
+
testOidc: vi.fn(),
|
|
10
|
+
syncNow: vi.fn(),
|
|
11
|
+
}));
|
|
12
|
+
vi.mock('../services/setup.api', async () => {
|
|
13
|
+
const actual = await vi.importActual<typeof import('../services/setup.api')>('../services/setup.api');
|
|
14
|
+
return { ...actual, ...api };
|
|
15
|
+
});
|
|
16
|
+
vi.mock('../../settings/services/github-facade.api', () => ({
|
|
17
|
+
fetchGitHubFacade: vi.fn(),
|
|
18
|
+
rotateGitHubFacade: vi.fn(),
|
|
19
|
+
fetchMarketplaceRegistration: vi.fn(async () => false),
|
|
20
|
+
setMarketplaceRegistration: vi.fn(),
|
|
21
|
+
}));
|
|
22
|
+
|
|
23
|
+
import { SetupScreen } from '../components/SetupScreen';
|
|
24
|
+
import { SettingsProblems, type GitMode, type RepositoryStatus, type SettingStatus } from '../services/setup.api';
|
|
25
|
+
|
|
26
|
+
const KB = 'knowledge-base' as const;
|
|
27
|
+
const setting = (key: string, extra: Partial<SettingStatus> = {}): SettingStatus => ({
|
|
28
|
+
key,
|
|
29
|
+
section: KB,
|
|
30
|
+
source: 'unset',
|
|
31
|
+
value: '',
|
|
32
|
+
configured: false,
|
|
33
|
+
secret: false,
|
|
34
|
+
restartToApply: false,
|
|
35
|
+
...extra,
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
/** A deployment's settings: nothing answered, or an address and a token stored. */
|
|
39
|
+
const settingsOf = (configured: boolean): SettingStatus[] => [
|
|
40
|
+
setting('gitMode', { envVar: 'GIT_MODE', restartToApply: true }),
|
|
41
|
+
setting('kbRepoUrl', configured ? { source: 'stored', configured: true, value: 'https://git.example.com/acme/kb.git' } : {}),
|
|
42
|
+
setting('gitToken', { secret: true, value: undefined, ...(configured ? { source: 'stored', configured: true } : {}) }),
|
|
43
|
+
setting('gitUsername'),
|
|
44
|
+
setting('knowledgeBaseDir', { restartToApply: true }),
|
|
45
|
+
setting('defaultBranch', configured ? { source: 'stored', configured: true, value: 'main' } : {}),
|
|
46
|
+
setting('protectedBranches', configured ? { source: 'stored', configured: true, value: 'main' } : {}),
|
|
47
|
+
];
|
|
48
|
+
|
|
49
|
+
const MODES: GitMode[] = ['managed', 'token'];
|
|
50
|
+
/** A deployment on `mode`, which has chosen `chosen`: the same way, unless a move is pending. */
|
|
51
|
+
const offering = (mode: GitMode | null, chosen: GitMode | null = mode, pinned?: string): RepositoryStatus => ({
|
|
52
|
+
mode,
|
|
53
|
+
chosen,
|
|
54
|
+
...(pinned ? { pinned } : {}),
|
|
55
|
+
modes: MODES,
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
function show(
|
|
59
|
+
opts: {
|
|
60
|
+
mode?: GitMode | null;
|
|
61
|
+
chosen?: GitMode | null;
|
|
62
|
+
pinned?: string;
|
|
63
|
+
configured?: boolean;
|
|
64
|
+
variant?: 'setup' | 'settings';
|
|
65
|
+
tabs?: boolean;
|
|
66
|
+
} = {},
|
|
67
|
+
) {
|
|
68
|
+
const configured = opts.configured ?? false;
|
|
69
|
+
const mode = opts.mode === undefined ? (configured ? 'token' : null) : opts.mode;
|
|
70
|
+
return render(
|
|
71
|
+
<SetupScreen
|
|
72
|
+
settings={settingsOf(configured)}
|
|
73
|
+
onSaved={() => {}}
|
|
74
|
+
variant={opts.variant ?? 'setup'}
|
|
75
|
+
{...(opts.tabs === false ? {} : { repository: offering(mode, opts.chosen === undefined ? mode : opts.chosen, opts.pinned) })}
|
|
76
|
+
/>,
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
const tab = (name: string) => screen.getByRole('tab', { name });
|
|
81
|
+
const address = () => screen.queryByLabelText('Repository address', { exact: false });
|
|
82
|
+
const save = () => userEvent.click(screen.getByRole('button', { name: 'Save and continue' }));
|
|
83
|
+
const saved = (mode: GitMode | null, configured: boolean) => ({
|
|
84
|
+
restartRequired: false,
|
|
85
|
+
complete: true,
|
|
86
|
+
settings: settingsOf(configured),
|
|
87
|
+
repository: offering(mode),
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
beforeEach(() => {
|
|
91
|
+
for (const fn of Object.values(api)) fn.mockReset();
|
|
92
|
+
Object.defineProperty(window, 'location', {
|
|
93
|
+
configurable: true,
|
|
94
|
+
value: { ...window.location, reload: vi.fn(), origin: 'https://example.test' },
|
|
95
|
+
});
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
describe('SetupScreen: the ways of having a repository', () => {
|
|
99
|
+
it('offers them as tabs, in the order the deployment gives', () => {
|
|
100
|
+
show();
|
|
101
|
+
const tabs = within(screen.getByRole('tablist', { name: 'Where the repository is' })).getAllByRole('tab');
|
|
102
|
+
expect(tabs.map((t) => t.textContent)).toEqual(['Managed for you', 'Address and token']);
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
it('opens a new deployment on the first: the repository it keeps itself', () => {
|
|
106
|
+
show();
|
|
107
|
+
expect(tab('Managed for you')).toHaveAttribute('aria-selected', 'true');
|
|
108
|
+
expect(screen.getByTestId('managed-repository')).toHaveTextContent('There is nothing to connect and nothing to enter');
|
|
109
|
+
// Nothing to type, nothing to test.
|
|
110
|
+
expect(address()).toBeNull();
|
|
111
|
+
expect(screen.queryByLabelText('Access token', { exact: false })).toBeNull();
|
|
112
|
+
expect(screen.queryByRole('button', { name: 'Test connection' })).toBeNull();
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
it('opens a configured deployment on the way it has, as it was', () => {
|
|
116
|
+
show({ configured: true, variant: 'settings' });
|
|
117
|
+
expect(tab('Address and token')).toHaveAttribute('aria-selected', 'true');
|
|
118
|
+
expect(address()).toHaveValue('https://git.example.com/acme/kb.git');
|
|
119
|
+
expect(screen.getByRole('button', { name: 'Test connection' })).toBeInTheDocument();
|
|
120
|
+
expect(screen.queryByTestId('moves-repository')).toBeNull();
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
it('gives each tab a panel of its own', async () => {
|
|
124
|
+
show();
|
|
125
|
+
for (const name of ['Managed for you', 'Address and token']) {
|
|
126
|
+
await userEvent.click(tab(name));
|
|
127
|
+
const panel = document.getElementById(tab(name).getAttribute('aria-controls')!);
|
|
128
|
+
expect(panel).toHaveAttribute('role', 'tabpanel');
|
|
129
|
+
expect(panel).toHaveAttribute('aria-labelledby', tab(name).id);
|
|
130
|
+
}
|
|
131
|
+
expect(within(document.getElementById('repository-panel-token')!).getByLabelText('Repository address', { exact: false })).toBeInTheDocument();
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
it('keeps what belongs to every repository under whichever tab is open', async () => {
|
|
135
|
+
show();
|
|
136
|
+
expect(screen.getByLabelText('Knowledge folder', { exact: false })).toBeInTheDocument();
|
|
137
|
+
await userEvent.click(tab('Address and token'));
|
|
138
|
+
expect(screen.getByLabelText('Knowledge folder', { exact: false })).toBeInTheDocument();
|
|
139
|
+
});
|
|
140
|
+
|
|
141
|
+
it('draws the one way there was, with no tabs, for a server that knows no other', () => {
|
|
142
|
+
show({ tabs: false });
|
|
143
|
+
expect(screen.queryByRole('tablist')).toBeNull();
|
|
144
|
+
expect(address()).toBeInTheDocument();
|
|
145
|
+
expect(screen.getByRole('button', { name: 'Test connection' })).toBeInTheDocument();
|
|
146
|
+
});
|
|
147
|
+
});
|
|
148
|
+
|
|
149
|
+
describe('SetupScreen: saving a repository the deployment keeps', () => {
|
|
150
|
+
it('finishes setup on the choice alone, without asking any host anything', async () => {
|
|
151
|
+
api.saveSettings.mockResolvedValue(saved('managed', false));
|
|
152
|
+
show();
|
|
153
|
+
await save();
|
|
154
|
+
await waitFor(() => expect(api.saveSettings).toHaveBeenCalledWith({ gitMode: 'managed' }));
|
|
155
|
+
expect(api.testConnection).not.toHaveBeenCalled();
|
|
156
|
+
});
|
|
157
|
+
|
|
158
|
+
it('does not store an address and a token that were typed on a tab that was then left', async () => {
|
|
159
|
+
api.saveSettings.mockResolvedValue(saved('managed', false));
|
|
160
|
+
show();
|
|
161
|
+
await userEvent.click(tab('Address and token'));
|
|
162
|
+
await userEvent.type(address()!, 'https://git.example.com/acme/kb.git');
|
|
163
|
+
await userEvent.type(screen.getByLabelText('Access token', { exact: false }), 'a-token');
|
|
164
|
+
await userEvent.click(tab('Managed for you'));
|
|
165
|
+
await save();
|
|
166
|
+
await waitFor(() => expect(api.saveSettings).toHaveBeenCalledWith({ gitMode: 'managed' }));
|
|
167
|
+
expect(api.testConnection).not.toHaveBeenCalled();
|
|
168
|
+
});
|
|
169
|
+
|
|
170
|
+
it('is not held back by a connection test that failed on the other tab', async () => {
|
|
171
|
+
api.testConnection.mockResolvedValue({ ok: false, outcome: 'rejected', error: 'The host turned that token down.' });
|
|
172
|
+
api.saveSettings.mockResolvedValue(saved('managed', false));
|
|
173
|
+
show();
|
|
174
|
+
await userEvent.click(tab('Address and token'));
|
|
175
|
+
await userEvent.type(address()!, 'https://git.example.com/acme/kb.git');
|
|
176
|
+
await userEvent.click(screen.getByRole('button', { name: 'Test connection' }));
|
|
177
|
+
await screen.findByText('The host turned that token down.');
|
|
178
|
+
expect(screen.getByRole('button', { name: 'Save and continue' })).toBeDisabled();
|
|
179
|
+
|
|
180
|
+
await userEvent.click(tab('Managed for you'));
|
|
181
|
+
expect(screen.getByRole('button', { name: 'Save and continue' })).toBeEnabled();
|
|
182
|
+
await save();
|
|
183
|
+
await waitFor(() => expect(api.saveSettings).toHaveBeenCalled());
|
|
184
|
+
});
|
|
185
|
+
|
|
186
|
+
it('says out loud why the choice was refused, since no field holds it', async () => {
|
|
187
|
+
api.saveSettings.mockRejectedValue(
|
|
188
|
+
new SettingsProblems({ gitMode: 'The repository could not be created on this deployment’s storage.' }),
|
|
189
|
+
);
|
|
190
|
+
show();
|
|
191
|
+
await save();
|
|
192
|
+
expect(await screen.findByText(/could not be created on this deployment/)).toBeInTheDocument();
|
|
193
|
+
});
|
|
194
|
+
});
|
|
195
|
+
|
|
196
|
+
describe('SetupScreen: saving a repository reached by its address', () => {
|
|
197
|
+
it('sends the way along with the address and the token on a deployment that has none', async () => {
|
|
198
|
+
api.testConnection.mockResolvedValue({ ok: true, outcome: 'connected', branches: ['main'], defaultBranch: 'main' });
|
|
199
|
+
api.saveSettings.mockResolvedValue(saved('token', true));
|
|
200
|
+
show();
|
|
201
|
+
await userEvent.click(tab('Address and token'));
|
|
202
|
+
await userEvent.type(address()!, 'https://git.example.com/acme/kb.git');
|
|
203
|
+
await userEvent.type(screen.getByLabelText('Access token', { exact: false }), 'a-token');
|
|
204
|
+
await save();
|
|
205
|
+
await waitFor(() => expect(api.saveSettings).toHaveBeenCalled());
|
|
206
|
+
expect(api.saveSettings.mock.calls[0]![0]).toMatchObject({
|
|
207
|
+
gitMode: 'token',
|
|
208
|
+
kbRepoUrl: 'https://git.example.com/acme/kb.git',
|
|
209
|
+
gitToken: 'a-token',
|
|
210
|
+
});
|
|
211
|
+
// Proven before it was stored, as ever.
|
|
212
|
+
expect(api.testConnection).toHaveBeenCalled();
|
|
213
|
+
});
|
|
214
|
+
|
|
215
|
+
it('says nothing about the way on a deployment that stays on the one it has', async () => {
|
|
216
|
+
api.saveSettings.mockResolvedValue(saved('token', true));
|
|
217
|
+
show({ configured: true, variant: 'settings' });
|
|
218
|
+
await userEvent.type(screen.getByLabelText('Knowledge folder', { exact: false }), 'Docs');
|
|
219
|
+
await save();
|
|
220
|
+
await waitFor(() => expect(api.saveSettings).toHaveBeenCalledWith({ knowledgeBaseDir: 'Docs' }));
|
|
221
|
+
});
|
|
222
|
+
|
|
223
|
+
it('opens the tab a refused address or token is on', async () => {
|
|
224
|
+
api.saveSettings.mockRejectedValue(new SettingsProblems({ gitToken: 'The host turned that token down.' }));
|
|
225
|
+
show({ configured: true, mode: 'managed', variant: 'settings' });
|
|
226
|
+
expect(tab('Managed for you')).toHaveAttribute('aria-selected', 'true');
|
|
227
|
+
await save();
|
|
228
|
+
expect(await screen.findByText('The host turned that token down.')).toBeInTheDocument();
|
|
229
|
+
expect(tab('Address and token')).toHaveAttribute('aria-selected', 'true');
|
|
230
|
+
});
|
|
231
|
+
});
|
|
232
|
+
|
|
233
|
+
describe('SetupScreen: moving a deployment to another repository', () => {
|
|
234
|
+
it('says what saving will do, before it is pressed', async () => {
|
|
235
|
+
show({ configured: true, variant: 'settings' });
|
|
236
|
+
await userEvent.click(tab('Managed for you'));
|
|
237
|
+
const warning = screen.getByTestId('moves-repository');
|
|
238
|
+
expect(warning).toHaveTextContent('moves this deployment to another repository');
|
|
239
|
+
expect(warning).toHaveTextContent('Nothing is deleted');
|
|
240
|
+
// Going back is staying: nothing to warn about.
|
|
241
|
+
await userEvent.click(tab('Address and token'));
|
|
242
|
+
expect(screen.queryByTestId('moves-repository')).toBeNull();
|
|
243
|
+
});
|
|
244
|
+
|
|
245
|
+
const moveButton = () => screen.getByRole('button', { name: 'Save and move' });
|
|
246
|
+
const agree = () => userEvent.click(screen.getByRole('checkbox', { name: /Move this deployment from/ }));
|
|
247
|
+
|
|
248
|
+
/**
|
|
249
|
+
* The tab is the choice, and the tab is a screen above the button. An
|
|
250
|
+
* admin who opens another way to read about it, changes a sign-in field
|
|
251
|
+
* and saves must not have moved the deployment to an empty repository.
|
|
252
|
+
*/
|
|
253
|
+
it('does not move on a save the admin was not asked about', async () => {
|
|
254
|
+
api.saveSettings.mockResolvedValue({ ...saved('token', true), repository: offering('token', 'managed') });
|
|
255
|
+
show({ configured: true, variant: 'settings' });
|
|
256
|
+
await userEvent.click(tab('Managed for you'));
|
|
257
|
+
await userEvent.type(screen.getByLabelText('Knowledge folder', { exact: false }), 'Docs');
|
|
258
|
+
|
|
259
|
+
// Asked at the button, naming what is left and what is moved to.
|
|
260
|
+
const asked = screen.getByTestId('confirm-move');
|
|
261
|
+
expect(asked).toHaveTextContent('Move this deployment from “Address and token” to “Managed for you”');
|
|
262
|
+
expect(asked).toHaveTextContent('Nothing is deleted');
|
|
263
|
+
expect(screen.queryByRole('button', { name: 'Save and continue' })).toBeNull();
|
|
264
|
+
expect(moveButton()).toBeDisabled();
|
|
265
|
+
await userEvent.click(moveButton());
|
|
266
|
+
expect(api.saveSettings).not.toHaveBeenCalled();
|
|
267
|
+
});
|
|
268
|
+
|
|
269
|
+
it('sends the move once the admin has said yes, and nothing of the repository it leaves', async () => {
|
|
270
|
+
api.saveSettings.mockResolvedValue({ ...saved('token', true), restartRequired: true, repository: offering('token', 'managed') });
|
|
271
|
+
show({ configured: true, variant: 'settings' });
|
|
272
|
+
await userEvent.click(tab('Managed for you'));
|
|
273
|
+
await agree();
|
|
274
|
+
await userEvent.click(moveButton());
|
|
275
|
+
await waitFor(() => expect(api.saveSettings).toHaveBeenCalledWith({ gitMode: 'managed' }));
|
|
276
|
+
expect(api.testConnection).not.toHaveBeenCalled();
|
|
277
|
+
});
|
|
278
|
+
|
|
279
|
+
it('asks again for another move: a yes to one is not a yes to the next', async () => {
|
|
280
|
+
render(
|
|
281
|
+
<SetupScreen
|
|
282
|
+
settings={settingsOf(true)}
|
|
283
|
+
onSaved={() => {}}
|
|
284
|
+
variant="settings"
|
|
285
|
+
repository={{ mode: 'token', chosen: 'token', modes: ['managed', 'github-app', 'token'] }}
|
|
286
|
+
/>,
|
|
287
|
+
);
|
|
288
|
+
await userEvent.click(tab('Managed for you'));
|
|
289
|
+
await agree();
|
|
290
|
+
expect(moveButton()).toBeEnabled();
|
|
291
|
+
await userEvent.click(tab('GitHub'));
|
|
292
|
+
expect(screen.getByRole('checkbox', { name: /to “GitHub”/ })).not.toBeChecked();
|
|
293
|
+
expect(moveButton()).toBeDisabled();
|
|
294
|
+
});
|
|
295
|
+
|
|
296
|
+
it('asks nothing of a save that stays where the deployment is', async () => {
|
|
297
|
+
api.saveSettings.mockResolvedValue(saved('token', true));
|
|
298
|
+
show({ configured: true, variant: 'settings' });
|
|
299
|
+
await userEvent.click(tab('Managed for you'));
|
|
300
|
+
await userEvent.click(tab('Address and token'));
|
|
301
|
+
expect(screen.queryByTestId('confirm-move')).toBeNull();
|
|
302
|
+
await userEvent.type(screen.getByLabelText('Knowledge folder', { exact: false }), 'Docs');
|
|
303
|
+
await save();
|
|
304
|
+
await waitFor(() => expect(api.saveSettings).toHaveBeenCalledWith({ knowledgeBaseDir: 'Docs' }));
|
|
305
|
+
});
|
|
306
|
+
|
|
307
|
+
it('asks nothing on a deployment that has no repository to leave', async () => {
|
|
308
|
+
api.saveSettings.mockResolvedValue(saved('managed', false));
|
|
309
|
+
show();
|
|
310
|
+
await userEvent.click(tab('Address and token'));
|
|
311
|
+
expect(screen.queryByTestId('moves-repository')).toBeNull();
|
|
312
|
+
expect(screen.queryByTestId('confirm-move')).toBeNull();
|
|
313
|
+
await userEvent.click(tab('Managed for you'));
|
|
314
|
+
await save();
|
|
315
|
+
await waitFor(() => expect(api.saveSettings).toHaveBeenCalledWith({ gitMode: 'managed' }));
|
|
316
|
+
});
|
|
317
|
+
});
|
|
318
|
+
|
|
319
|
+
describe('SetupScreen: between a move and the restart it owes', () => {
|
|
320
|
+
it('opens on the way chosen, and says the deployment is still on the one it has', () => {
|
|
321
|
+
show({ configured: true, mode: 'token', chosen: 'managed', variant: 'settings' });
|
|
322
|
+
expect(tab('Managed for you')).toHaveAttribute('aria-selected', 'true');
|
|
323
|
+
const pending = screen.getByTestId('move-pending');
|
|
324
|
+
expect(pending).toHaveTextContent('A restart is pending');
|
|
325
|
+
expect(pending).toHaveTextContent('still working on “Address and token”');
|
|
326
|
+
// The move was made: it is not offered again, and not asked about again.
|
|
327
|
+
expect(screen.queryByTestId('moves-repository')).toBeNull();
|
|
328
|
+
expect(screen.queryByTestId('confirm-move')).toBeNull();
|
|
329
|
+
});
|
|
330
|
+
|
|
331
|
+
it('does not send the move a second time with a save about something else', async () => {
|
|
332
|
+
api.saveSettings.mockResolvedValue({ ...saved('token', true), restartRequired: true, repository: offering('token', 'managed') });
|
|
333
|
+
show({ configured: true, mode: 'token', chosen: 'managed', variant: 'settings' });
|
|
334
|
+
await userEvent.type(screen.getByLabelText('Knowledge folder', { exact: false }), 'Docs');
|
|
335
|
+
await save();
|
|
336
|
+
await waitFor(() => expect(api.saveSettings).toHaveBeenCalledWith({ knowledgeBaseDir: 'Docs' }));
|
|
337
|
+
});
|
|
338
|
+
|
|
339
|
+
it('takes the move back by saving on the way in effect, without being asked', async () => {
|
|
340
|
+
api.saveSettings.mockResolvedValue(saved('token', true));
|
|
341
|
+
show({ configured: true, mode: 'token', chosen: 'managed', variant: 'settings' });
|
|
342
|
+
await userEvent.click(tab('Address and token'));
|
|
343
|
+
expect(screen.getByTestId('move-taken-back')).toHaveTextContent('Saving takes the move back');
|
|
344
|
+
expect(screen.queryByTestId('confirm-move')).toBeNull();
|
|
345
|
+
await save();
|
|
346
|
+
await waitFor(() => expect(api.saveSettings).toHaveBeenCalledWith({ gitMode: 'token' }));
|
|
347
|
+
});
|
|
348
|
+
|
|
349
|
+
it('reads a server that does not tell the two apart as one that has no move pending', () => {
|
|
350
|
+
render(<SetupScreen settings={settingsOf(true)} onSaved={() => {}} variant="settings" repository={{ mode: 'token', modes: MODES }} />);
|
|
351
|
+
expect(tab('Address and token')).toHaveAttribute('aria-selected', 'true');
|
|
352
|
+
expect(screen.queryByTestId('move-pending')).toBeNull();
|
|
353
|
+
});
|
|
354
|
+
});
|
|
355
|
+
|
|
356
|
+
describe('SetupScreen: a way chosen by the environment', () => {
|
|
357
|
+
it('shows the other ways as not the screen to choose, and says which variable chose', async () => {
|
|
358
|
+
show({ mode: 'managed', pinned: 'GIT_MODE', variant: 'settings' });
|
|
359
|
+
expect(tab('Managed for you')).toHaveAttribute('aria-selected', 'true');
|
|
360
|
+
expect(tab('Managed for you')).toBeEnabled();
|
|
361
|
+
expect(tab('Address and token')).toBeDisabled();
|
|
362
|
+
expect(screen.getByTestId('repository-pinned')).toHaveTextContent('Set by the GIT_MODE environment variable');
|
|
363
|
+
await userEvent.click(tab('Address and token'));
|
|
364
|
+
expect(tab('Managed for you')).toHaveAttribute('aria-selected', 'true');
|
|
365
|
+
expect(screen.queryByTestId('confirm-move')).toBeNull();
|
|
366
|
+
});
|
|
367
|
+
|
|
368
|
+
it('says nothing of the kind when the admin chose', () => {
|
|
369
|
+
show({ mode: 'managed', variant: 'settings' });
|
|
370
|
+
expect(tab('Address and token')).toBeEnabled();
|
|
371
|
+
expect(screen.queryByTestId('repository-pinned')).toBeNull();
|
|
372
|
+
});
|
|
373
|
+
});
|