update link registration site to executive dashboard
This commit is contained in:
1 parent
1e6f6b3b57
commit
d0d1ae7d24
26 files changed
+1044
-55
No files matched your search
@@ -10,11 +10,11 @@ const { createKandangMock, createFlockMock, createCycleMock, updateCycleMock, re
|
||||
updateCycleMock: vi.fn(),
|
||||
reloadMock: vi.fn().mockResolvedValue(undefined),
|
||||
farmState: {
|
||||
sites: [{ id: 7, site_name: 'Site A', user: 99, created_at: '', updated_at: '' }],
|
||||
sites: [{ id: 'site-a', site_name: 'Site A', user: 99, created_at: '', updated_at: '' }],
|
||||
kandangs: [] as Array<{
|
||||
id: number;
|
||||
kandang_name: string;
|
||||
site: number;
|
||||
site: string;
|
||||
created_at: string;
|
||||
updated_at: string;
|
||||
}>,
|
||||
@@ -26,7 +26,7 @@ const { createKandangMock, createFlockMock, createCycleMock, updateCycleMock, re
|
||||
updated_at: string;
|
||||
}>,
|
||||
cycles: [] as unknown[],
|
||||
selectedSiteId: 7,
|
||||
selectedSiteId: 'site-a',
|
||||
selectedKandangId: null as number | null,
|
||||
selectedCycleId: null as number | null,
|
||||
selectedCycle: null as unknown,
|
||||
@@ -97,14 +97,14 @@ describe('SettingsPage settings forms', () => {
|
||||
farmState.kandangs = [];
|
||||
farmState.flocks = [];
|
||||
farmState.cycles = [];
|
||||
farmState.selectedSiteId = 7;
|
||||
farmState.selectedSiteId = 'site-a';
|
||||
farmState.selectedKandangId = null;
|
||||
farmState.selectedCycleId = null;
|
||||
farmState.selectedCycle = null;
|
||||
createKandangMock.mockResolvedValue({
|
||||
id: 11,
|
||||
kandang_name: 'Kandang 1',
|
||||
site: 7,
|
||||
site: 'site-a',
|
||||
created_at: '',
|
||||
updated_at: '',
|
||||
});
|
||||
@@ -155,13 +155,13 @@ describe('SettingsPage settings forms', () => {
|
||||
await waitFor(() => expect(createKandangMock).toHaveBeenCalledTimes(1));
|
||||
expect(createKandangMock).toHaveBeenCalledWith({
|
||||
kandang_name: 'Kandang 1',
|
||||
site: 7,
|
||||
site: 'site-a',
|
||||
});
|
||||
});
|
||||
|
||||
it('submits flock fields for the selected kandang', async () => {
|
||||
farmState.kandangs = [
|
||||
{ id: 11, kandang_name: 'Kandang 1', site: 7, created_at: '', updated_at: '' },
|
||||
{ id: 11, kandang_name: 'Kandang 1', site: 'site-a', created_at: '', updated_at: '' },
|
||||
];
|
||||
farmState.selectedKandangId = 11;
|
||||
|
||||
@@ -181,7 +181,7 @@ describe('SettingsPage settings forms', () => {
|
||||
|
||||
it('submits cycle fields without flock assignment', async () => {
|
||||
farmState.kandangs = [
|
||||
{ id: 11, kandang_name: 'Kandang 1', site: 7, created_at: '', updated_at: '' },
|
||||
{ id: 11, kandang_name: 'Kandang 1', site: 'site-a', created_at: '', updated_at: '' },
|
||||
];
|
||||
farmState.selectedKandangId = 11;
|
||||
|
||||
@@ -207,7 +207,7 @@ describe('SettingsPage settings forms', () => {
|
||||
|
||||
it('updates an existing cycle from the edit form', async () => {
|
||||
farmState.kandangs = [
|
||||
{ id: 11, kandang_name: 'Kandang 1', site: 7, created_at: '', updated_at: '' },
|
||||
{ id: 11, kandang_name: 'Kandang 1', site: 'site-a', created_at: '', updated_at: '' },
|
||||
];
|
||||
farmState.selectedKandangId = 11;
|
||||
farmState.cycles = [
|
||||
|
||||
Reference in new issue
Block a user