Unit tests should not be strict on html contents

Bug #1517084 reported by Diana Whitten
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
Fix Released
Undecided
Steve McLellan

Bug Description

Several unit tests are using an expected string value and comparing the entire contents of an HTML element just to determine if it contains a class of 'disabled'.

This makes Horizon extremely difficult to customize and makes the unit tests extremely fragile.

Steve McLellan (sjmc7)
Changed in horizon:
assignee: nobody → Steve McLellan (sjmc7)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to horizon (master)

Fix proposed to branch: master
Review: https://review.openstack.org/246549

Changed in horizon:
status: New → In Progress
Changed in horizon:
assignee: Steve McLellan (sjmc7) → Diana Whitten (hurgleburgler)
Changed in horizon:
assignee: Diana Whitten (hurgleburgler) → Steve McLellan (sjmc7)
Changed in horizon:
assignee: Steve McLellan (sjmc7) → Diana Whitten (hurgleburgler)
Changed in horizon:
assignee: Diana Whitten (hurgleburgler) → Steve McLellan (sjmc7)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to horizon (master)

Reviewed: https://review.openstack.org/246549
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=d76a61346ebc0d7eb860fe72230ea3a9d1c88022
Submitter: Jenkins
Branch: master

commit d76a61346ebc0d7eb860fe72230ea3a9d1c88022
Author: Steve McLellan <email address hidden>
Date: Tue Nov 17 12:36:31 2015 -0600

    Make unit testing less reliant on HTML fragments

    Some tests check for equality with quite large HTML fragments, when
    the test is only interested in certain specific things (and not style
    changes etc). This patch alters some of those tests (specifically ones
    that were tripping up a dependent patch, but can be expanded) to check
    the context data of the response, since the actual rendering is tested
    by horizon's tests.

    It also adds tests to check context data in 'normal' circumstances so
    that no test coverage should be lost by this.

    Change-Id: I09be82058edc923521ffb4c022515845a18b158d
    Closes-Bug: #1517084

Changed in horizon:
status: In Progress → Fix Committed
Revision history for this message
Doug Hellmann (doug-hellmann) wrote : Fix included in openstack/horizon 9.0.0.0b1

This issue was fixed in the openstack/horizon 9.0.0.0b1 development milestone.

Changed in horizon:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.