2
0
mirror of https://github.com/inventree/inventree-app.git synced 2026-02-06 12:55:50 +00:00

Image url fix (#765)

* Bump release notes

* Improve URL resolution

* Add URL tests

* Add debug for CI

* Fix stock adjustment URLs

* Fix barcode URLs
This commit is contained in:
Oliver
2026-02-05 21:08:12 +11:00
committed by GitHub
parent 934742efda
commit 3c8c263327
5 changed files with 47 additions and 24 deletions

View File

@@ -23,6 +23,27 @@ void main() {
assert(await UserProfileDBManager().selectProfileByName(testServerName));
});
// Ensure that generated URLs are correct
group("URL Tests:", () {
test("Generate URLs", () async {
UserProfile profile = await setupServerProfile();
var api = InvenTreeAPI();
api.profile = profile;
Map<String, String> tests = {
"": "http://localhost:8000/api/",
"barcode/": "http://localhost:8000/api/barcode/",
"https://remote-server.com/media/image.png":
"https://remote-server.com/media/image.png",
};
for (var test in tests.entries) {
expect(api.makeApiUrl(test.key), equals(test.value));
}
});
});
group("Login Tests:", () {
test("Disconnected", () async {
// Test that calling disconnect() does the right thing