Skip to content

Commit 402352b

Browse files
committed
mozilla/remote-settings#923: add tooltip when local/server timestamp
1 parent fc7e500 commit 402352b

File tree

2 files changed

+20
-7
lines changed

2 files changed

+20
-7
lines changed

extension/content/script.js

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,16 @@ async function refreshUI(state) {
9191
document.getElementById("polling-url").setAttribute("href", pollingEndpoint);
9292
document.getElementById("local-timestamp").textContent = localTimestamp;
9393
document.getElementById("server-timestamp").textContent = serverTimestamp;
94-
document.getElementById("human-local-timestamp").className =
94+
95+
const tsElt = document.getElementById("human-local-timestamp");
96+
tsElt.className =
9597
localTimestamp == serverTimestamp ? " up-to-date" : " unsync";
96-
document.getElementById("human-local-timestamp").textContent =
97-
humanDate(localTimestamp);
98+
tsElt.textContent = humanDate(localTimestamp);
99+
tsElt.setAttribute(
100+
"title",
101+
localTimestamp == serverTimestamp ? "Synced" : "Local data is out of sync",
102+
);
103+
98104
document.getElementById("human-server-timestamp").textContent =
99105
humanDate(serverTimestamp);
100106
document.getElementById("last-check").textContent = humanDate(
@@ -144,13 +150,19 @@ async function refreshUI(state) {
144150
);
145151
tableRow.querySelector(".server-timestamp").textContent =
146152
serverTimestampCollection;
147-
tableRow.querySelector(".human-local-timestamp").className +=
153+
const tsRowElt = tableRow.querySelector(".human-local-timestamp");
154+
tsRowElt.className =
148155
localTimestampCollection == serverTimestampCollection
149156
? " up-to-date"
150157
: " unsync";
151-
tableRow.querySelector(".human-local-timestamp").textContent = humanDate(
152-
localTimestampCollection,
158+
tsRowElt.textContent = humanDate(localTimestampCollection);
159+
tsRowElt.setAttribute(
160+
"title",
161+
localTimestampCollection == serverTimestampCollection
162+
? "Synced"
163+
: "Local data is out of sync",
153164
);
165+
154166
tableRow.querySelector(".local-timestamp").textContent = localTimestamp;
155167
tableRow.querySelector(".last-check").textContent = humanDate(
156168
lastCheckCollection * 1000,

tests/selenium.spec.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ beforeAll(async () => {
2222
options.setBinary(process.env.NIGHTLY_PATH || "/usr/bin/firefox-nightly");
2323
options.addArguments("--pref 'extensions.experiments.enabled=true'");
2424
options.addArguments("--headless");
25+
options.addArguments("--temp-profile");
2526
options.setPreference("xpinstall.signatures.required", false);
2627
options.setPreference("extensions.experiments.enabled", true);
2728
options.setPreference(
@@ -111,7 +112,6 @@ async function clickByCss(css, retries = 3) {
111112

112113
describe("End to end browser tests", () => {
113114
test("Load extension, change environment to prod, sync and clear all", async () => {
114-
// select prod environment from dropdown
115115
await clickByCss("#environment");
116116
await clickByCss('#environment [value="prod"]');
117117
await waitForLoad();
@@ -141,6 +141,7 @@ describe("End to end browser tests", () => {
141141
// clear all data
142142
await clickByCss("#clear-all-data");
143143
await waitForLoad();
144+
await waitForLoad();
144145

145146
// verify everything is cleared as expected
146147
expect(

0 commit comments

Comments
 (0)