{"size": 1718, "ext": "js", "max_stars_repo_path": "javascript/code-challenges/queue-and-stack/queue-with-stacks/__tests__/stacks.test.js", "max_stars_repo_name": "JTaisey389/data-structures-and-algorithms.md", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "javascript/code-challenges/queue-and-stack/queue-with-stacks/__tests__/stacks.test.js", "max_issues_repo_name": "JTaisey389/data-structures-and-algorithms.md", "max_issues_repo_issues_event_min_datetime": "2021-02-21T23:19:53.000Z", "max_issues_repo_issues_event_max_datetime": "2021-03-08T20:14:20.000Z", "max_forks_repo_path": "javascript/code-challenges/queue-and-stack/queue-with-stacks/__tests__/stacks.test.js", "max_forks_repo_name": "JTaisey389/data-structures-and-algorithms.md", "max_forks_repo_forks_event_min_datetime": "2021-05-26T19:52:08.000Z", "max_forks_repo_forks_event_max_datetime": "2021-05-26T19:52:08.000Z"}
{"max_stars_count": null, "max_issues_count": 8, "max_forks_count": 1, "avg_line_length": 27.7096774194, "max_line_length": 89, "alphanum_fraction": 0.6047729919}
'use strict';

const PseudoQueue = require('../Pseudo-queue');

xdescribe('===Test for Stacks===', () => {
  it('should create a new PseudoQueue', () => {
    let stack = new PseudoQueue;
    expect(stack.top).toEqual(null);
  });
  it('should add a Node to the stack', () => {
    let stack = new PseudoQueue;
    let first = 12;

    stack.push(first);
    expect(stack.top.value).toEqual(12);
  });
  it('should add multiple nodes to the  PseudoQueue', () => {
    let stack = new PseudoQueue;
    let first = 12;
    let second = 30;

    stack.push(first);
    expect(stack.top.value).toEqual(12);
    stack.push(second);
    expect(stack.top.next).toEqual({'next': null, 'value': 30});
  });
  it('should remove multiple nodes from the PseudoQueue', () => {
    let stack = new PseudoQueue;
    let first = 12;
    let second = 30;
    let third = 35;

    stack.push(first);
    stack.push(second);
    stack.push(third);
    stack.pop();
    stack.pop();
    expect(stack.peek()).toEqual(first);
  });
  it('should return the value of the top of the  PseudoQueue', () => {
    let stack = new PseudoQueue;
    let first = 12;
    let second = 30;

    stack.push(first);
    stack.push(second);
    expect(stack.peek()).toEqual(second);
  });
  it('should return the values of all the numbers in the PseudoQueue', () => {
    let stack = new PseudoQueue;
    let returnVal = '{ 30 } => { 12 } => NULL';
    stack.push(12);
    stack.push(30);
    expect(stack.print).toEqual(returnVal);
  });
  it('should return null when trying to remove a node from an empty PseudoQueue', () => {
    let stack = new PseudoQueue;
    console.log(`check empty ${stack.pop()}`);
    expect(stack.pop).toEqual(null);
  });
});
