Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hyrax 5 upgrade spec fixing #2089

Merged
merged 3 commits into from
Dec 20, 2023
Merged

Conversation

jeremyf
Copy link
Contributor

@jeremyf jeremyf commented Dec 20, 2023

🤖 Extract constant to ease testing

13775d6

We're not concerned with where the cached file is for testing purposes;
so instead of hard-coding a value that can change in the ENV, let's
compare the constant that we use in the code.

tl;dr - Don't rely on magic strings

🤖 Re-arrange CleanupAccountJob specs

0dbddad

The CleanupAccountJob was stubbing very nosily; needing to know too
much about implementation details of the end-points. Instead this
preserves the over-view spec (e.g. what all the cleanup spec actually
cleans up) while moving that nosy logic to the constituent endpoint.

Most of these specs are testing that the method chains work; which is
perhaps adequate as the other option is far more expensive tests (e.g.
make a new Fedora node only to then immediately destroy it)

I'm also leveraging the new Redis::Namespace#clear method.

Related to:

We're not concerned with where the cached file is for testing purposes;
so instead of hard-coding a value that can change in the ENV, let's
compare the constant that we use in the code.

tl;dr - Don't rely on magic strings
The `CleanupAccountJob` was stubbing very nosily; needing to know too
much about implementation details of the end-points.  Instead this
preserves the over-view spec (e.g. what all the cleanup spec actually
cleans up) while moving that nosy logic to the constituent endpoint.

Most of these specs are testing that the method chains work; which is
perhaps adequate as the other option is far more expensive tests (e.g.
make a new Fedora node only to then immediately destroy it)

I'm also leveraging the new `Redis::Namespace#clear` method.

Related to:

- resque/redis-namespace#202
allColorInputs.each(function() {
$(this).val($(this).data('default-value'))
})
})

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing semicolon.


allColorInputs.each(function() {
$(this).val($(this).data('default-value'))
})

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing semicolon.

var allColorInputs = $("input[name*='color']")

allColorInputs.each(function() {
$(this).val($(this).data('default-value'))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing semicolon.

$('.panel-footer a.restore-all-default-colors').click(function(e) {
e.preventDefault()

var allColorInputs = $("input[name*='color']")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing semicolon.

})

$('.panel-footer a.restore-all-default-colors').click(function(e) {
e.preventDefault()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing semicolon.

var input = $("input[name='admin_appearance["+ defaultTarget +"]']")

input.val(input.data('default-value'))
})

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing semicolon.

var defaultTarget = $(e.target).data('default-target')
var input = $("input[name='admin_appearance["+ defaultTarget +"]']")

input.val(input.data('default-value'))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing semicolon.

e.preventDefault()

var defaultTarget = $(e.target).data('default-target')
var input = $("input[name='admin_appearance["+ defaultTarget +"]']")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing semicolon.

$('div.defaultable-colors a.restore-default-color').click(function(e) {
e.preventDefault()

var defaultTarget = $(e.target).data('default-target')

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing semicolon.

@@ -0,0 +1,20 @@
$(document).on('turbolinks:load', function() {
$('div.defaultable-colors a.restore-default-color').click(function(e) {
e.preventDefault()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing semicolon.

allColorInputs.each(function() {
$(this).val($(this).data('default-value'))
})
})

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing semicolon.


allColorInputs.each(function() {
$(this).val($(this).data('default-value'))
})

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing semicolon.

var allColorInputs = $("input[name*='color']")

allColorInputs.each(function() {
$(this).val($(this).data('default-value'))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing semicolon.

$('.panel-footer a.restore-all-default-colors').click(function(e) {
e.preventDefault()

var allColorInputs = $("input[name*='color']")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing semicolon.

})

$('.panel-footer a.restore-all-default-colors').click(function(e) {
e.preventDefault()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing semicolon.

var input = $("input[name='admin_appearance["+ defaultTarget +"]']")

input.val(input.data('default-value'))
})

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing semicolon.

var defaultTarget = $(e.target).data('default-target')
var input = $("input[name='admin_appearance["+ defaultTarget +"]']")

input.val(input.data('default-value'))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing semicolon.

e.preventDefault()

var defaultTarget = $(e.target).data('default-target')
var input = $("input[name='admin_appearance["+ defaultTarget +"]']")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing semicolon.

$('div.defaultable-colors a.restore-default-color').click(function(e) {
e.preventDefault()

var defaultTarget = $(e.target).data('default-target')

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing semicolon.

@@ -0,0 +1,20 @@
$(document).on('turbolinks:load', function() {
$('div.defaultable-colors a.restore-default-color').click(function(e) {
e.preventDefault()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing semicolon.

allColorInputs.each(function() {
$(this).val($(this).data('default-value'))
})
})

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing semicolon.


allColorInputs.each(function() {
$(this).val($(this).data('default-value'))
})

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing semicolon.

var allColorInputs = $("input[name*='color']")

allColorInputs.each(function() {
$(this).val($(this).data('default-value'))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing semicolon.

$('.panel-footer a.restore-all-default-colors').click(function(e) {
e.preventDefault()

var allColorInputs = $("input[name*='color']")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing semicolon.

})

$('.panel-footer a.restore-all-default-colors').click(function(e) {
e.preventDefault()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing semicolon.

$('div.defaultable-colors a.restore-default-color').click(function(e) {
e.preventDefault()

var defaultTarget = $(e.target).data('default-target')

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing semicolon.

@@ -0,0 +1,20 @@
$(document).on('turbolinks:load', function() {
$('div.defaultable-colors a.restore-default-color').click(function(e) {
e.preventDefault()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing semicolon.

// Grab the data from the ul div
var series_data = new Array();
var pointer_lookup = new Array();
var x_ticks = new Array();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The array literal notation [] is preferable.

if (domDependenciesMet()) {
// Grab the data from the ul div
var series_data = new Array();
var pointer_lookup = new Array();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The array literal notation [] is preferable.

//flot loaded? And canvas element supported.
if (domDependenciesMet()) {
// Grab the data from the ul div
var series_data = new Array();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The array literal notation [] is preferable.

allColorInputs.each(function() {
$(this).val($(this).data('default-value'))
})
})

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing semicolon.


allColorInputs.each(function() {
$(this).val($(this).data('default-value'))
})

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing semicolon.

var allColorInputs = $("input[name*='color']")

allColorInputs.each(function() {
$(this).val($(this).data('default-value'))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing semicolon.

$('.panel-footer a.restore-all-default-colors').click(function(e) {
e.preventDefault()

var allColorInputs = $("input[name*='color']")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing semicolon.

})

$('.panel-footer a.restore-all-default-colors').click(function(e) {
e.preventDefault()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing semicolon.

@@ -0,0 +1,20 @@
$(document).on('turbolinks:load', function() {
$('div.defaultable-colors a.restore-default-color').click(function(e) {
e.preventDefault()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing semicolon.

// Grab the data from the ul div
var series_data = new Array();
var pointer_lookup = new Array();
var x_ticks = new Array();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The array literal notation [] is preferable.

if (domDependenciesMet()) {
// Grab the data from the ul div
var series_data = new Array();
var pointer_lookup = new Array();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The array literal notation [] is preferable.

//flot loaded? And canvas element supported.
if (domDependenciesMet()) {
// Grab the data from the ul div
var series_data = new Array();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The array literal notation [] is preferable.

};

global.BlacklightRangeLimit = BlacklightRangeLimit;
}(this);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Expected an assignment or function call and instead saw an expression.

allColorInputs.each(function() {
$(this).val($(this).data('default-value'))
})
})

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing semicolon.


allColorInputs.each(function() {
$(this).val($(this).data('default-value'))
})

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing semicolon.

var allColorInputs = $("input[name*='color']")

allColorInputs.each(function() {
$(this).val($(this).data('default-value'))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing semicolon.

$('.panel-footer a.restore-all-default-colors').click(function(e) {
e.preventDefault()

var allColorInputs = $("input[name*='color']")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing semicolon.

})

$('.panel-footer a.restore-all-default-colors').click(function(e) {
e.preventDefault()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing semicolon.

if (domDependenciesMet()) {
// Grab the data from the ul div
var series_data = new Array();
var pointer_lookup = new Array();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The array literal notation [] is preferable.

//flot loaded? And canvas element supported.
if (domDependenciesMet()) {
// Grab the data from the ul div
var series_data = new Array();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The array literal notation [] is preferable.

};

global.BlacklightRangeLimit = BlacklightRangeLimit;
}(this);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Expected an assignment or function call and instead saw an expression.

max = BlacklightRangeLimit.parseNum($(range_element).find(".max").first().text());
}

return [min, max]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing semicolon.




var min = max = BlacklightRangeLimit.parseNum(current_limit.find(".single").text())

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing semicolon.
You might be leaking a variable (max) here.

@jeremyf jeremyf changed the base branch from main to hyrax-5-upgrade December 20, 2023 19:44
@jeremyf jeremyf merged commit 875df7a into hyrax-5-upgrade Dec 20, 2023
1 of 3 checks passed
@jeremyf jeremyf deleted the hyrax-5-upgrade-spec-fixing branch December 20, 2023 21:43
@kirkkwang kirkkwang mentioned this pull request Jan 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants