feat(db/userstore): add avatar, email, bgColor to user profile
This commit is contained in:
parent
5f31cfc867
commit
817ced61de
14 changed files with 69 additions and 110 deletions
|
@ -128,6 +128,7 @@ func DefaultConfigStruct() *Config {
|
|||
Repeat: "repeat",
|
||||
Position: "fixed",
|
||||
Align: "center",
|
||||
BgColor: "#ccc",
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
|
@ -119,6 +119,7 @@ func TestLoadCfg(t *testing.T) {
|
|||
Repeat: "1",
|
||||
Position: "1",
|
||||
Align: "1",
|
||||
BgColor: "1",
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -184,6 +185,7 @@ func TestLoadCfg(t *testing.T) {
|
|||
Repeat: "4",
|
||||
Position: "4",
|
||||
Align: "4",
|
||||
BgColor: "4",
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -249,6 +251,7 @@ func TestLoadCfg(t *testing.T) {
|
|||
Repeat: "4",
|
||||
Position: "4",
|
||||
Align: "4",
|
||||
BgColor: "4",
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -314,6 +317,7 @@ func TestLoadCfg(t *testing.T) {
|
|||
Repeat: "no-repeat",
|
||||
Position: "top",
|
||||
Align: "scroll",
|
||||
BgColor: "", // the schema of the config from db is old
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -349,7 +353,7 @@ func TestLoadCfg(t *testing.T) {
|
|||
}
|
||||
|
||||
if !Equal(gotCfg, expectCfg) {
|
||||
t.Fatal("cfgs are not identical")
|
||||
t.Fatalf("%d, cfgs are not identical", i)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -170,6 +170,7 @@ func initDeps(cfg gocfg.ICfg) *depidx.Deps {
|
|||
Repeat: cfg.StringOr("Site.ClientCfg.Bg.Repeat", "repeat"),
|
||||
Position: cfg.StringOr("Site.ClientCfg.Bg.Position", "fixed"),
|
||||
Align: cfg.StringOr("Site.ClientCfg.Bg.Align", "center"),
|
||||
BgColor: cfg.StringOr("Site.ClientCfg.Bg.BgColor", "#ccc"),
|
||||
},
|
||||
},
|
||||
})
|
||||
|
|
|
@ -79,10 +79,11 @@ func TestSettingsHandlers(t *testing.T) {
|
|||
SiteName: "quickshare",
|
||||
SiteDesc: "quickshare",
|
||||
Bg: &sitestore.BgConfig{
|
||||
Url: "",
|
||||
Repeat: "",
|
||||
Position: "",
|
||||
Align: "",
|
||||
Url: "url",
|
||||
Repeat: "repeat",
|
||||
Position: "center",
|
||||
Align: "fixed",
|
||||
BgColor: "#ccc",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
@ -453,6 +453,7 @@ func TestUsersHandlers(t *testing.T) {
|
|||
Repeat: "no-repeat",
|
||||
Position: "center",
|
||||
Align: "fixed",
|
||||
BgColor: "#ccc",
|
||||
},
|
||||
CSSURL: "/cssurl",
|
||||
LanPackURL: "/lanpack",
|
||||
|
@ -463,6 +464,7 @@ func TestUsersHandlers(t *testing.T) {
|
|||
Repeat: "no-repeat2",
|
||||
Position: "center2",
|
||||
Align: "fixed2",
|
||||
BgColor: "#333",
|
||||
},
|
||||
CSSURL: "/cssurl2",
|
||||
LanPackURL: "/lanpack2",
|
||||
|
|
1
src/server/testdata/config_1.yml
vendored
1
src/server/testdata/config_1.yml
vendored
|
@ -46,6 +46,7 @@ site:
|
|||
repeat: "1"
|
||||
position: "1"
|
||||
align: "1"
|
||||
bgColor: "1"
|
||||
db:
|
||||
dbPath: "1"
|
||||
|
||||
|
|
1
src/server/testdata/config_4.yml
vendored
1
src/server/testdata/config_4.yml
vendored
|
@ -46,5 +46,6 @@ site:
|
|||
repeat: "4"
|
||||
position: "4"
|
||||
align: "4"
|
||||
bgColor: "4"
|
||||
db:
|
||||
dbPath: "4"
|
BIN
src/server/testdata/test_quickshare.db
vendored
BIN
src/server/testdata/test_quickshare.db
vendored
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue