Skip to content

Commit 735f2b9

Browse files
committed
♻️ Remove duplicated strategy and tests (#2446)
1 parent 80d5e96 commit 735f2b9

File tree

2 files changed

+0
-41
lines changed

2 files changed

+0
-41
lines changed

src/lib/utils/authorship.ts

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,6 @@ const formCreationStrategies = [
6464
return { form: { ...form, message: '' } };
6565
},
6666
},
67-
{
68-
name: 'Use zod adapter explicitly',
69-
async run() {
70-
const zodAdapter = zod(authSchema);
71-
const form = await superValidate(null, zodAdapter);
72-
return { form: { ...form, message: '' } };
73-
},
74-
},
7567
{
7668
name: 'Create form by manually defining structure',
7769
async run() {
@@ -128,14 +120,6 @@ const formValidationStrategies = [
128120
return { form: { ...form, message: '' } };
129121
},
130122
},
131-
{
132-
name: 'Use zod adapter explicitly with request',
133-
async run(request: Request) {
134-
const zodAdapter = zod(authSchema);
135-
const form = await superValidate(request, zodAdapter);
136-
return { form: { ...form, message: '' } };
137-
},
138-
},
139123
{
140124
name: 'Create fallback form manually',
141125
async run(_request: Request) {

src/test/lib/utils/authorship.test.ts

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -67,31 +67,6 @@ describe('createAuthFormWithFallback', () => {
6767
});
6868
});
6969

70-
test('expect to fallback to explicit zod adapter when basic strategy fails', async () => {
71-
const mockForm = {
72-
id: 'test-form-id',
73-
valid: true,
74-
posted: false,
75-
data: { username: '', password: '' },
76-
errors: {},
77-
constraints: {},
78-
shape: {},
79-
};
80-
81-
vi.mocked(superValidate)
82-
.mockRejectedValueOnce(new Error('Failed to create with basic strategy'))
83-
.mockResolvedValueOnce(mockForm);
84-
vi.mocked(zod).mockReturnValue({} as any);
85-
86-
const result = await createAuthFormWithFallback();
87-
88-
expect(result.form).toMatchObject({
89-
valid: true,
90-
data: { username: '', password: '' },
91-
message: '',
92-
});
93-
});
94-
9570
test('expect to use manual form creation when all superValidate attempts fail', async () => {
9671
vi.mocked(superValidate)
9772
.mockRejectedValueOnce(new Error('Failed to create strategy using SuperValidate'))

0 commit comments

Comments
 (0)