Merge pull request #4322 from hashicorp/feature/unignore-startup-tests

Reset `<html class>` after every test, back to its original static value
This commit is contained in:
John Cowen 2018-07-03 10:45:08 +01:00 committed by GitHub
commit aa067c049a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 3 deletions

View File

@ -3,7 +3,6 @@ Feature: startup
In order to give users an indication as early as possible that they are at the right place In order to give users an indication as early as possible that they are at the right place
As a user As a user
I should be able to see a startup logo I should be able to see a startup logo
@ignore
Scenario: When loading the index.html file into a browser Scenario: When loading the index.html file into a browser
Given 1 datacenter model with the value "dc-1" Given 1 datacenter model with the value "dc-1"
Then the url should be '' Then the url should be ''

View File

@ -3,6 +3,18 @@ import { skip } from 'qunit';
import { setupApplicationTest, setupRenderingTest, setupTest } from 'ember-qunit'; import { setupApplicationTest, setupRenderingTest, setupTest } from 'ember-qunit';
import api from 'consul-ui/tests/helpers/api'; import api from 'consul-ui/tests/helpers/api';
const staticClassList = [...document.documentElement.classList];
function reset() {
window.localStorage.clear();
api.server.reset();
const list = document.documentElement.classList;
while (list.length > 0) {
list.remove(list.item(0));
}
staticClassList.forEach(function(item) {
list.add(item);
});
}
// this logic could be anything, but in this case... // this logic could be anything, but in this case...
// if @ignore, then return skip (for backwards compatibility) // if @ignore, then return skip (for backwards compatibility)
// if have annotations in config, then only run those that have a matching annotation // if have annotations in config, then only run those that have a matching annotation
@ -64,8 +76,7 @@ function setupScenario(featureAnnotations, scenarioAnnotations) {
} }
return function(model) { return function(model) {
model.afterEach(function() { model.afterEach(function() {
window.localStorage.clear(); reset();
api.server.reset();
}); });
}; };
// return setupFn; // return setupFn;