Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Issue #316 fixed #27

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

Merged
alesanchezr merged 1 commit into 4GeeksAcademy:master from tommygonzaleza:master
Aug 11, 2021
Merged

Conversation

@tommygonzaleza
Copy link
Contributor

@tommygonzaleza tommygonzaleza commented Aug 11, 2021

No description provided.

@alesanchezr alesanchezr merged commit 0502062 into 4GeeksAcademy:master Aug 11, 2021
let link = document.querySelector('link').href

expect(meta).toBe(null)
expect(link).toBe('http://localhost/styles.css')
Copy link
Member

@alesanchezr alesanchezr Oct 11, 2021

Choose a reason for hiding this comment

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

Don't include the domain, use the url node package to retrieve just the pathname and not the domain, like this:

const pathname = new URL(document.querySelector('link').href).pathname


let meta = document.querySelector('head').querySelector("meta")

expect(meta).toBe(null)
Copy link
Member

@alesanchezr alesanchezr Oct 11, 2021

Choose a reason for hiding this comment

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

split this in to expects, the first makes sure the head is not null,

the second one makes sure the meta is null.

let title = head.querySelector('title').innerHTML

expect(meta).toBe(null)
expect(link).toBe('http://localhost/styles.css')
Copy link
Member

@alesanchezr alesanchezr Oct 11, 2021

Choose a reason for hiding this comment

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

The test will not work on gitpod, make sure the domain its not part of the link using 👍

const pathname = new URL(document.querySelector('link').href).pathname

expect(html.toString().indexOf(`<style`)>-1).toBeFalsy();
it("You should not change the existing head tag elements", function () {
let head = document.querySelector('head');
let meta = head.querySelector("meta")
Copy link
Member

@alesanchezr alesanchezr Oct 11, 2021

Choose a reason for hiding this comment

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

check that the head is expected to be tobe.truthful()

Copy link
Member

@alesanchezr alesanchezr Oct 11, 2021

Choose a reason for hiding this comment

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

tambien podrias decir not to be null

expect(html.toString().indexOf(`<style`)>-1).toBeFalsy();
it("You should not change the existing head tag elements", function () {
let head = document.querySelector('head');
let meta = head.querySelector("meta")
Copy link
Member

@alesanchezr alesanchezr Oct 11, 2021

Choose a reason for hiding this comment

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

checkea que el head not tobe null

let title = head.querySelector('title')

expect(meta).not.toBe(null)
expect(link).toBe('http://localhost/styles.css')
Copy link
Member

@alesanchezr alesanchezr Oct 11, 2021

Choose a reason for hiding this comment

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

dont harcode localhost

expect(html.toString().indexOf(`<style`)>-1).toBeFalsy();
it("You should not change the existing head tag elements", function () {
let head = document.querySelector('head');
let meta = head.querySelector("meta")
Copy link
Member

@alesanchezr alesanchezr Oct 11, 2021

Choose a reason for hiding this comment

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

checkea que el head not tobe null

let title = head.querySelector('title')

expect(meta).not.toBe(null)
expect(link).toBe('http://localhost/styles.css')
Copy link
Member

@alesanchezr alesanchezr Oct 11, 2021

Choose a reason for hiding this comment

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

dont harcode localhost

let title = head.querySelector('title')

expect(meta).not.toBe(null)
expect(link).toBe('http://localhost/styles.css')
Copy link
Member

@alesanchezr alesanchezr Oct 11, 2021

Choose a reason for hiding this comment

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

dont harcode localhost


it("You should not change the existing head tag elements", function () {
let head = document.querySelector('head');
let meta = head.querySelector("meta")
Copy link
Member

@alesanchezr alesanchezr Oct 11, 2021

Choose a reason for hiding this comment

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

checkea que el head not tobe null

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@alesanchezr alesanchezr alesanchezr approved these changes

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /