From a7574d2a93eb699ade9ffb3adad952be8da99461 Mon Sep 17 00:00:00 2001 From: chloe Date: Wed, 18 Mar 2026 21:52:04 +0000 Subject: [PATCH] Updated tests --- Seasoned.Backend/Data/ApplicationDbContext.cs | 25 ++++++++--- Seasoned.Frontend/app/pages/gallery.vue | 2 +- Seasoned.Frontend/test/GalleryPage.spec.ts | 43 +++++++++++++++++++ Seasoned.Frontend/test/Uploader.spec.ts | 9 +++- 4 files changed, 72 insertions(+), 7 deletions(-) diff --git a/Seasoned.Backend/Data/ApplicationDbContext.cs b/Seasoned.Backend/Data/ApplicationDbContext.cs index b365067..1b7765e 100644 --- a/Seasoned.Backend/Data/ApplicationDbContext.cs +++ b/Seasoned.Backend/Data/ApplicationDbContext.cs @@ -16,11 +16,26 @@ public class ApplicationDbContext : IdentityDbContext { base.OnModelCreating(modelBuilder); - modelBuilder.HasPostgresExtension("vector"); + if (Database.IsNpgsql()) + { + modelBuilder.HasPostgresExtension("vector"); + } - modelBuilder.Entity() - .HasOne() - .WithMany() - .HasForeignKey(r => r.UserId); + modelBuilder.Entity(entity => + { + entity.HasOne() + .WithMany() + .HasForeignKey(r => r.UserId); + + if (Database.ProviderName == "Microsoft.EntityFrameworkCore.InMemory") + { + entity.Ignore(r => r.Embedding); + } + else + { + entity.Property(r => r.Embedding) + .HasColumnType("vector(1536)"); + } + }); } } \ No newline at end of file diff --git a/Seasoned.Frontend/app/pages/gallery.vue b/Seasoned.Frontend/app/pages/gallery.vue index de02520..4091fed 100644 --- a/Seasoned.Frontend/app/pages/gallery.vue +++ b/Seasoned.Frontend/app/pages/gallery.vue @@ -233,7 +233,7 @@