DEV: prevents staff computed property to be overridden (#7931)

This commit is contained in:
Joffrey JAFFEUX
2019-07-24 22:01:08 +02:00
committed by GitHub
parent cc46de8f46
commit c1d2fb115c
19 changed files with 47 additions and 42 deletions

View File

@ -20,7 +20,7 @@ acceptance("Topic - Edit timer", {
});
QUnit.test("default", async assert => {
updateCurrentUser({ admin: true, staff: true, canManageTopic: true });
updateCurrentUser({ moderator: true, canManageTopic: true });
const timerType = selectKit(".select-kit.timer-type");
const futureDateInputSelector = selectKit(".future-date-input-selector");
@ -41,7 +41,7 @@ QUnit.test("default", async assert => {
});
QUnit.test("autoclose - specific time", async assert => {
updateCurrentUser({ admin: true, staff: true, canManageTopic: true });
updateCurrentUser({ moderator: true, canManageTopic: true });
const futureDateInputSelector = selectKit(".future-date-input-selector");
await visit("/t/internationalization-localization");
@ -62,7 +62,7 @@ QUnit.test("autoclose - specific time", async assert => {
});
QUnit.test("autoclose", async assert => {
updateCurrentUser({ admin: true, staff: true, canManageTopic: true });
updateCurrentUser({ moderator: true, canManageTopic: true });
const futureDateInputSelector = selectKit(".future-date-input-selector");
await visit("/t/internationalization-localization");
@ -117,7 +117,7 @@ QUnit.test("autoclose", async assert => {
});
QUnit.test("close temporarily", async assert => {
updateCurrentUser({ admin: true, staff: true, canManageTopic: true });
updateCurrentUser({ moderator: true, canManageTopic: true });
const timerType = selectKit(".select-kit.timer-type");
const futureDateInputSelector = selectKit(".future-date-input-selector");
@ -159,7 +159,7 @@ QUnit.test("close temporarily", async assert => {
});
QUnit.test("schedule", async assert => {
updateCurrentUser({ admin: true, staff: true, canManageTopic: true });
updateCurrentUser({ moderator: true, canManageTopic: true });
const timerType = selectKit(".select-kit.timer-type");
const categoryChooser = selectKit(".modal-body .category-chooser");
const futureDateInputSelector = selectKit(".future-date-input-selector");
@ -194,7 +194,7 @@ QUnit.test("schedule", async assert => {
});
QUnit.test("TL4 can't auto-delete", async assert => {
updateCurrentUser({ staff: false, trust_level: 4 });
updateCurrentUser({ moderator: false, admin: false, trust_level: 4 });
await visit("/t/internationalization-localization");
await click(".toggle-admin-menu");
@ -208,7 +208,7 @@ QUnit.test("TL4 can't auto-delete", async assert => {
});
QUnit.test("auto delete", async assert => {
updateCurrentUser({ admin: true, staff: true, canManageTopic: true });
updateCurrentUser({ moderator: true, canManageTopic: true });
const timerType = selectKit(".select-kit.timer-type");
const futureDateInputSelector = selectKit(".future-date-input-selector");
@ -238,7 +238,7 @@ QUnit.test("auto delete", async assert => {
QUnit.test(
"Manually closing before the timer will clear the status text",
async assert => {
updateCurrentUser({ admin: true, staff: true, canManageTopic: true });
updateCurrentUser({ moderator: true, canManageTopic: true });
const futureDateInputSelector = selectKit(".future-date-input-selector");
await visit("/t/internationalization-localization");
@ -265,7 +265,7 @@ QUnit.test(
);
QUnit.test("Inline delete timer", async assert => {
updateCurrentUser({ admin: true, staff: true, canManageTopic: true });
updateCurrentUser({ moderator: true, canManageTopic: true });
const futureDateInputSelector = selectKit(".future-date-input-selector");
await visit("/t/internationalization-localization");