Disable welcome item since it broke some tests

This should move to a function that adds the item through the normal methods and runs on db init
This commit is contained in:
Tim Van Baak 2025-02-12 09:38:10 -08:00
parent 879238e61e
commit 7c8b4ee3a3
3 changed files with 9 additions and 9 deletions

View File

@ -36,7 +36,7 @@ func TestChannel(t *testing.T) {
if err != nil {
t.Fatalf("failed to get sources in channel: %v", err)
}
if len(sources) != 1 || sources["channel"][0] != "two" {
if len(sources["channel"]) != 1 || sources["channel"][0] != "two" {
t.Fatalf("unexpected sources in channel after deletion: %v", sources)
}
if err := AddSourceToChannel(db, "channel", "one"); err != nil {

View File

@ -104,7 +104,7 @@ func TestDeleteSourceCascade(t *testing.T) {
t.Fatalf("failed to get active items: %v", err)
}
if len(items) != 2 {
t.Fatal("Expected 2 items")
t.Fatalf("Expected 2 items, got %d", len(items))
}
if err := DeleteSource(db, "source1"); err != nil {

View File

@ -52,10 +52,10 @@ create table sessions(
) strict;
-- user introduction
insert into sources (name) values ('default');
insert into channels (name, source) values ('home', 'default');
insert into actions (source, name, argv) values ('default', 'fetch', jsonb('["true"]'));
insert into items (source, id, active, title, author, body, link, time, ttl, ttd, tts, action)
values ('default', 'welcome', 1, 'Welcome to intake!', 'intake',
'<p>Click the "X" button on this item to deactivate it and hide it from the feed.</p>',
'', 1, 0, 0, 0, jsonb('null'))
-- insert into sources (name) values ('default');
-- insert into channels (name, source) values ('home', 'default');
-- insert into actions (source, name, argv) values ('default', 'fetch', jsonb('["true"]'));
-- insert into items (source, id, active, title, author, body, link, time, ttl, ttd, tts, action)
-- values ('default', 'welcome', 1, 'Welcome to intake!', 'intake',
-- '<p>Click the "X" button on this item to deactivate it and hide it from the feed.</p>',
-- '', 1, 0, 0, 0, jsonb('null'))