Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version 2.1 #41

Merged
merged 123 commits into from
Mar 27, 2024
Merged
Changes from 1 commit
Commits
Show all changes
123 commits
Select commit Hold shift + click to select a range
5b27ea5
Add canonical domain support (#37)
danieljsummers Jul 9, 2023
5f5927c
First cut of Docker files (#38)
danieljsummers Jul 9, 2023
9dd6ab7
Add Sqlite Docker file
danieljsummers Jul 19, 2023
ab9f2f5
Use PG lib data source singleton
danieljsummers Jul 28, 2023
42d3280
Add redirect rule to data stores (#39)
danieljsummers Jul 29, 2023
3ef4499
Add redirect index page (#39)
danieljsummers Jul 29, 2023
dc6b066
Rule add/edit/move/delete works (#39)
danieljsummers Jul 31, 2023
693a1df
Redirect plain-text rules (#39)
danieljsummers Jul 31, 2023
f43c431
Verify regex rules work correctly (#39)
danieljsummers Aug 1, 2023
79c3044
Add doc link to redirect page (#39)
danieljsummers Aug 1, 2023
b84a0f7
Add chapter data type (#6)
danieljsummers Aug 1, 2023
715e545
Update deps
danieljsummers Dec 13, 2023
ec2d43a
WIP on SQLite/JSON data
danieljsummers Dec 13, 2023
7071d60
WIP on module/member conversion
danieljsummers Dec 15, 2023
5fe2077
WIP on module/member conversion
danieljsummers Dec 16, 2023
d8ce59a
WIP on module/member conversion
danieljsummers Dec 16, 2023
c3d615d
WIP on module/member conversion
danieljsummers Dec 16, 2023
8ec84e8
WIP on module/member conversion
danieljsummers Dec 16, 2023
cb02055
WIP on formatting
danieljsummers Dec 17, 2023
a439430
Update Postgres data implementation
danieljsummers Dec 17, 2023
58b83b8
WIP on SQLite JSON documents
danieljsummers Dec 17, 2023
2062840
WIP on SQLite JSON documents
danieljsummers Dec 18, 2023
e04c8b5
First cut of SQLite JSON doc complete
danieljsummers Dec 18, 2023
d330c97
WIP on SQLite doc library
danieljsummers Dec 19, 2023
bb4252f
WIP on SQLite doc library
danieljsummers Dec 19, 2023
f461b10
First cut of SQLite doc library
danieljsummers Dec 20, 2023
7fb68d5
Rename SQLite helper file
danieljsummers Dec 20, 2023
e8d6379
Migrate Postgres data to new library
danieljsummers Dec 31, 2023
1a50c68
Migrate SQLite data to new library
danieljsummers Dec 31, 2023
dee2222
Register serliazer for SQLite
danieljsummers Dec 31, 2023
b69b6c3
WIP on testing SQLite data store
danieljsummers Jan 4, 2024
5a3d9f0
Rework migration; add PG 2.1 changes
danieljsummers Jan 4, 2024
3226f88
Implement /data and /themes directories (#38)
danieljsummers Jan 5, 2024
75e13a5
Add chapters waypoint flag (#6)
danieljsummers Jan 5, 2024
2c052c1
Add test project
danieljsummers Jan 6, 2024
cac1174
Add CommentStatus and ExplicitRating tests
danieljsummers Jan 6, 2024
5c08049
Finish SupportTypes tests
danieljsummers Jan 7, 2024
5126e20
Add tests for DataTypes
danieljsummers Jan 7, 2024
6622529
Add some view model tests
danieljsummers Jan 8, 2024
dc80388
Add more view model tests
danieljsummers Jan 9, 2024
8ec7610
Tweak domain tests
danieljsummers Jan 9, 2024
ba42f84
Add DisplayUser tests
danieljsummers Jan 10, 2024
10affa2
Add EditCategoryModel tests
danieljsummers Jan 11, 2024
29cbf48
Split tests into separate files
danieljsummers Jan 11, 2024
29167ec
Add podcast/user edit model tests
danieljsummers Jan 11, 2024
12c46c8
Add edit page model tests
danieljsummers Jan 13, 2024
888f56e
WIP on edit post model tests
danieljsummers Jan 14, 2024
cb94222
Finish edit post model tests
danieljsummers Jan 15, 2024
cbe391f
Add edit redirect tests
danieljsummers Jan 16, 2024
9da9a94
Add tests through mng rev
danieljsummers Jan 19, 2024
da5918b
Update admin/default templates
danieljsummers Jan 20, 2024
d50056c
Finish view model tests
danieljsummers Jan 20, 2024
a0ab99f
Add unquoted relative URL support
danieljsummers Jan 20, 2024
5ce84e1
Fix SQLite page list query
danieljsummers Jan 20, 2024
d1a9606
Tweak admin theme changes
danieljsummers Jan 20, 2024
cfb3c3a
Add JSON converter tests
danieljsummers Jan 21, 2024
ffe6713
Add converter / utils tests
danieljsummers Jan 21, 2024
1345074
Add framework for SQLite data tests
danieljsummers Jan 21, 2024
3835ed9
Rearrange test files
danieljsummers Jan 21, 2024
182b33a
Add Category tests, implement for SQLite
danieljsummers Jan 22, 2024
13994a2
Convert to rc2 of doc lib
danieljsummers Jan 24, 2024
19777c7
Add Postgres Category tests
danieljsummers Jan 25, 2024
d09a5e1
Add data test for Page.Add
danieljsummers Jan 26, 2024
f701fc9
Add data test for Page.All
danieljsummers Jan 26, 2024
0e8044b
Add RethinkDB tests
danieljsummers Jan 27, 2024
3f269ed
Add Page Find[Full]ById tests
danieljsummers Jan 28, 2024
c319ff1
Add tests for pages via permalinks
danieljsummers Jan 28, 2024
f60139d
Add more page tests
danieljsummers Jan 29, 2024
0a53e27
Add page-of-page and update tests
danieljsummers Jan 29, 2024
990b72b
Finish page data tests
danieljsummers Jan 30, 2024
78c1c5e
Add framework for post tests
danieljsummers Jan 31, 2024
24d49e2
Add tests through post curr permalink
danieljsummers Jan 31, 2024
84460b4
Add post FindFull* tests
danieljsummers Feb 2, 2024
05d49e6
Finish post data tests
danieljsummers Feb 3, 2024
8183da7
Add tag mapping tests
danieljsummers Feb 3, 2024
b1a0c20
Add theme tests
danieljsummers Feb 3, 2024
ff05bc8
Add theme asset tests
danieljsummers Feb 3, 2024
34315a1
Add upload tests
danieljsummers Feb 3, 2024
ac9df44
Add user add/find-by-[email|id] tests
danieljsummers Feb 3, 2024
16f7396
Finish user tests
danieljsummers Feb 4, 2024
f25426d
Add web log tests
danieljsummers Feb 4, 2024
d378f69
Add chapter source fields (#6)
danieljsummers Feb 6, 2024
90bca34
WIP on chapter list page (#6)
danieljsummers Feb 8, 2024
12b23ea
WIP on chapter edit page (#6)
danieljsummers Feb 9, 2024
1463247
WIP on chapter edit form (#6)
danieljsummers Feb 11, 2024
d3c89da
WIP on chapter edit form (#6)
danieljsummers Feb 11, 2024
6a5285c
WIP on saving chapters (#6)
danieljsummers Mar 4, 2024
43a700e
WIP on chapter flow (#6)
danieljsummers Mar 10, 2024
641a749
Complete chapter edit page (#6)
danieljsummers Mar 10, 2024
8103957
WIP on ?chapters handler for posts (#6)
danieljsummers Mar 11, 2024
5b8a632
Complete main chapter functionality (#6)
danieljsummers Mar 11, 2024
90e6f78
Migrate post list template
danieljsummers Mar 11, 2024
5f114c7
Move redirect/tag map templates to GVE
danieljsummers Mar 12, 2024
b99cd5b
Migrate more templates to GVE
danieljsummers Mar 13, 2024
e9bd3b2
Migrate web log settings page to GVE
danieljsummers Mar 13, 2024
cac7b1d
Migrate page list template to GVE
danieljsummers Mar 14, 2024
b85cae2
Tweak to chapter edit template
danieljsummers Mar 15, 2024
91046c6
Migrate custom feed page to GVE
danieljsummers Mar 15, 2024
3998399
Migrate several templates to GVE
danieljsummers Mar 15, 2024
ddab491
First cut of common edit model
danieljsummers Mar 15, 2024
ec04fea
Migrate page edit to GVE
danieljsummers Mar 16, 2024
a448339
Migrate post edit to GVE
danieljsummers Mar 16, 2024
6459931
Eliminate final admin theme Liquid resources
danieljsummers Mar 16, 2024
54e46fd
Remove unneeded types
danieljsummers Mar 16, 2024
4301788
Bug fixes with new admin forms
danieljsummers Mar 16, 2024
31d49d4
Fix "add category" button (#40)
danieljsummers Mar 17, 2024
f181f83
Misc admin theme tweaks
danieljsummers Mar 17, 2024
ac332a6
Fix Docker builds (#38)
danieljsummers Mar 20, 2024
dce80fd
Fix theme zipping in Docker (#38)
danieljsummers Mar 23, 2024
c20628b
Update deps before release
danieljsummers Mar 23, 2024
895b2a7
Update build files
danieljsummers Mar 23, 2024
2fe104f
Add GitHub Actions YAML
danieljsummers Mar 23, 2024
add6a80
Add Rethink URI, run tests after cd
danieljsummers Mar 23, 2024
5c7e897
Enable .NET 7
danieljsummers Mar 23, 2024
eaa1824
Enable .NET 8
danieljsummers Mar 23, 2024
ad49c95
Add release packaging
danieljsummers Mar 23, 2024
5ba05bd
Add CI flag to build
danieljsummers Mar 23, 2024
aa2707d
Use matrix for publish job
danieljsummers Mar 24, 2024
c9a097a
Fix indentation
danieljsummers Mar 24, 2024
d28b18a
Remove name from artifact upload
danieljsummers Mar 24, 2024
5fc3d11
Include matrix vars in artifact name
danieljsummers Mar 24, 2024
2439d01
Fix indents in CI YAML
danieljsummers Mar 24, 2024
d8024ac
Add chapter ref to feed (#6)
danieljsummers Mar 26, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add user add/find-by-[email|id] tests
danieljsummers committed Feb 3, 2024
commit ac9df44904f498e17b61100254d09a790a5ec82d
29 changes: 29 additions & 0 deletions src/MyWebLog.Tests/Data/PostgresDataTests.fs
Original file line number Diff line number Diff line change
@@ -549,6 +549,34 @@ let private uploadTests = testList "Upload" [
]
]

let private webLogUserTests = testList "WebLogUser" [
testTask "Add succeeds" {
do! WebLogUserDataTests.``Add succeeds`` (mkData ())
}
testList "FindByEmail" [
testTask "succeeds when a user is found" {
do! WebLogUserDataTests.``FindByEmail succeeds when a user is found`` (mkData ())
}
testTask "succeeds when a user is not found (incorrect weblog)" {
do! WebLogUserDataTests.``FindByEmail succeeds when a user is not found (incorrect weblog)`` (mkData ())
}
testTask "succeeds when a user is not found (bad email)" {
do! WebLogUserDataTests.``FindByEmail succeeds when a user is not found (bad email)`` (mkData ())
}
]
testList "FindById" [
testTask "succeeds when a user is found" {
do! WebLogUserDataTests.``FindById succeeds when a user is found`` (mkData ())
}
testTask "succeeds when a user is not found (incorrect weblog)" {
do! WebLogUserDataTests.``FindById succeeds when a user is not found (incorrect weblog)`` (mkData ())
}
testTask "succeeds when a user is not found (bad ID)" {
do! WebLogUserDataTests.``FindById succeeds when a user is not found (bad ID)`` (mkData ())
}
]
]

/// Drop the throwaway PostgreSQL database
let private environmentCleanUp = test "Clean Up" {
if db.IsSome then db.Value.Dispose()
@@ -565,5 +593,6 @@ let all =
themeTests
themeAssetTests
uploadTests
webLogUserTests
environmentCleanUp ]
|> testSequenced
29 changes: 29 additions & 0 deletions src/MyWebLog.Tests/Data/RethinkDbDataTests.fs
Original file line number Diff line number Diff line change
@@ -549,6 +549,34 @@ let private uploadTests = testList "Upload" [
]
]

let private webLogUserTests = testList "WebLogUser" [
testTask "Add succeeds" {
do! WebLogUserDataTests.``Add succeeds`` data.Value
}
testList "FindByEmail" [
testTask "succeeds when a user is found" {
do! WebLogUserDataTests.``FindByEmail succeeds when a user is found`` data.Value
}
testTask "succeeds when a user is not found (incorrect weblog)" {
do! WebLogUserDataTests.``FindByEmail succeeds when a user is not found (incorrect weblog)`` data.Value
}
testTask "succeeds when a user is not found (bad email)" {
do! WebLogUserDataTests.``FindByEmail succeeds when a user is not found (bad email)`` data.Value
}
]
testList "FindById" [
testTask "succeeds when a user is found" {
do! WebLogUserDataTests.``FindById succeeds when a user is found`` data.Value
}
testTask "succeeds when a user is not found (incorrect weblog)" {
do! WebLogUserDataTests.``FindById succeeds when a user is not found (incorrect weblog)`` data.Value
}
testTask "succeeds when a user is not found (bad ID)" {
do! WebLogUserDataTests.``FindById succeeds when a user is not found (bad ID)`` data.Value
}
]
]

/// Drop the throwaway RethinkDB database
let private environmentCleanUp = testTask "Clean Up" {
do! disposeData ()
@@ -565,5 +593,6 @@ let all =
themeTests
themeAssetTests
uploadTests
webLogUserTests
environmentCleanUp ]
|> testSequenced
43 changes: 43 additions & 0 deletions src/MyWebLog.Tests/Data/SQLiteDataTests.fs
Original file line number Diff line number Diff line change
@@ -812,6 +812,48 @@ let private uploadTests = testList "Upload" [
]
]

let private webLogUserTests = testList "WebLogUser" [
testTask "Add succeeds" {
let data = mkData ()
try do! WebLogUserDataTests.``Add succeeds`` data
finally dispose data
}
testList "FindByEmail" [
testTask "succeeds when a user is found" {
let data = mkData ()
try do! WebLogUserDataTests.``FindByEmail succeeds when a user is found`` data
finally dispose data
}
testTask "succeeds when a user is not found (incorrect weblog)" {
let data = mkData ()
try do! WebLogUserDataTests.``FindByEmail succeeds when a user is not found (incorrect weblog)`` data
finally dispose data
}
testTask "succeeds when a user is not found (bad email)" {
let data = mkData ()
try do! WebLogUserDataTests.``FindByEmail succeeds when a user is not found (bad email)`` data
finally dispose data
}
]
testList "FindById" [
testTask "succeeds when a user is found" {
let data = mkData ()
try do! WebLogUserDataTests.``FindById succeeds when a user is found`` data
finally dispose data
}
testTask "succeeds when a user is not found (incorrect weblog)" {
let data = mkData ()
try do! WebLogUserDataTests.``FindById succeeds when a user is not found (incorrect weblog)`` data
finally dispose data
}
testTask "succeeds when a user is not found (bad ID)" {
let data = mkData ()
try do! WebLogUserDataTests.``FindById succeeds when a user is not found (bad ID)`` data
finally dispose data
}
]
]

/// Delete the SQLite database
let private environmentCleanUp = test "Clean Up" {
File.Delete dbName
@@ -829,5 +871,6 @@ let all =
themeTests
themeAssetTests
uploadTests
webLogUserTests
environmentCleanUp ]
|> testSequenced
86 changes: 86 additions & 0 deletions src/MyWebLog.Tests/Data/WebLogUserDataTests.fs
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
/// <summary>
/// Integration tests for <see cref="IWebLogUserData" /> implementations
/// </summary>
module WebLogUserDataTests

open Expecto
open MyWebLog
open MyWebLog.Data
open NodaTime

/// The ID of the root web log
let private rootId = CategoryDataTests.rootId

/// The ID of the admin user
let private adminId = WebLogUserId "5EM2rimH9kONpmd2zQkiVA"

/// The ID of the editor user
let private editorId = WebLogUserId "GPbJaSOwTkKt14ZKYyveKA"

/// The ID of the author user
let private authorId = WebLogUserId "iIRNLSeY0EanxRPyqGuwVg"

/// The ID of the user added during the run of these tests
let private newId = WebLogUserId "new-user"

let ``Add succeeds`` (data: IData) = task {
do! data.WebLogUser.Add
{ Id = newId
WebLogId = rootId
Email = "new@example.com"
FirstName = "New"
LastName = "User"
PreferredName = "n00b"
PasswordHash = "hashed-password"
Url = Some "https://example.com/~new"
AccessLevel = Author
CreatedOn = Noda.epoch + Duration.FromDays 365
LastSeenOn = None }
let! user = data.WebLogUser.FindById newId rootId
Expect.isSome user "There should have been a user returned"
let it = user.Value
Expect.equal it.Id newId "ID is incorrect"
Expect.equal it.WebLogId rootId "Web log ID is incorrect"
Expect.equal it.Email "new@example.com" "E-mail address is incorrect"
Expect.equal it.FirstName "New" "First name is incorrect"
Expect.equal it.LastName "User" "Last name is incorrect"
Expect.equal it.PreferredName "n00b" "Preferred name is incorrect"
Expect.equal it.PasswordHash "hashed-password" "Password hash is incorrect"
Expect.equal it.Url (Some "https://example.com/~new") "URL is incorrect"
Expect.equal it.AccessLevel Author "Access level is incorrect"
Expect.equal it.CreatedOn (Noda.epoch + Duration.FromDays 365) "Created on is incorrect"
Expect.isNone it.LastSeenOn "Last seen on should not have had a value"
}

let ``FindByEmail succeeds when a user is found`` (data: IData) = task {
let! user = data.WebLogUser.FindByEmail "root@example.com" rootId
Expect.isSome user "There should have been a user returned"
Expect.equal user.Value.Id adminId "The wrong user was returned"
}

let ``FindByEmail succeeds when a user is not found (incorrect weblog)`` (data: IData) = task {
let! user = data.WebLogUser.FindByEmail "root@example.com" (WebLogId "other")
Expect.isNone user "There should not have been a user returned"
}

let ``FindByEmail succeeds when a user is not found (bad email)`` (data: IData) = task {
let! user = data.WebLogUser.FindByEmail "wwwdata@example.com" rootId
Expect.isNone user "There should not have been a user returned"
}

let ``FindById succeeds when a user is found`` (data: IData) = task {
let! user = data.WebLogUser.FindById adminId rootId
Expect.isSome user "There should have been a user returned"
Expect.equal user.Value.Id adminId "The wrong user was returned"
// The remainder of field population is tested in the "Add succeeds" test above
}

let ``FindById succeeds when a user is not found (incorrect weblog)`` (data: IData) = task {
let! user = data.WebLogUser.FindById adminId (WebLogId "not-admin")
Expect.isNone user "There should not have been a user returned"
}

let ``FindById succeeds when a user is not found (bad ID)`` (data: IData) = task {
let! user = data.WebLogUser.FindById (WebLogUserId "tom") rootId
Expect.isNone user "There should not have been a user returned"
}
1 change: 1 addition & 0 deletions src/MyWebLog.Tests/MyWebLog.Tests.fsproj
Original file line number Diff line number Diff line change
@@ -16,6 +16,7 @@
<Compile Include="Data\TagMapDataTests.fs" />
<Compile Include="Data\ThemeDataTests.fs" />
<Compile Include="Data\UploadDataTests.fs" />
<Compile Include="Data\WebLogUserDataTests.fs" />
<Compile Include="Data\RethinkDbDataTests.fs" />
<Compile Include="Data\SQLiteDataTests.fs" />
<Compile Include="Data\PostgresDataTests.fs" />