Skip to content

Commit

Permalink
fix: drop old comment and notifyProp prop, rename visibility fixture
Browse files Browse the repository at this point in the history
Signed-off-by: Patrik Kullman <[email protected]>
  • Loading branch information
Patrik Kullman authored and cristinecula committed Apr 15, 2020
1 parent 05d4662 commit 111e122
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 17 deletions.
1 change: 0 additions & 1 deletion cosmoz-data-nav.js
Original file line number Diff line number Diff line change
Expand Up @@ -760,7 +760,6 @@ class CosmozDataNav extends translatable(mixinBehaviors([IronResizableBehavior],
if (selectedElement == null) {
return;
}
// index 0 is incomplete element
return selectedElement.children[0];
}

Expand Down
4 changes: 2 additions & 2 deletions test/basic.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
import sinon from 'sinon';

import {
customStyle, defaultsFixture, flushRenderQueue, getItems, setupFixture
visibilityFixture, defaultsFixture, flushRenderQueue, getItems, setupFixture
} from './helpers/utils.js';

import '../cosmoz-data-nav.js';
Expand Down Expand Up @@ -351,7 +351,7 @@ suite('renderQueue', () => {

setup(async () => {
[, nav] = await Promise.all([
fixture(customStyle),
fixture(visibilityFixture),
setupFixture(html`
<cosmoz-data-nav elements-buffer="5">
<template>
Expand Down
4 changes: 2 additions & 2 deletions test/bugs.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import '../cosmoz-data-nav.js';
import './helpers/cosmoz-data-nav-test-view.js';
import { Base } from '@polymer/polymer/polymer-legacy';
import {
customStyle, defaultsFixture, flushRenderQueue, selectedSlide, isVisible, setupFixture
visibilityFixture, defaultsFixture, flushRenderQueue, selectedSlide, isVisible, setupFixture
} from './helpers/utils';

const oneRequestPerItem = async nav => {
Expand Down Expand Up @@ -130,7 +130,7 @@ suite('bugs', () => {

test('selected instance not set', async () => {
const [, nav] = await Promise.all([
fixture(customStyle),
fixture(visibilityFixture),
await setupFixture()
]);
nav.setItemById('0', { id: '0' });
Expand Down
7 changes: 1 addition & 6 deletions test/helpers/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,11 @@ export const
},
nextDisabled: {
type: Boolean
},
notifyProp: {
type: Boolean,
notify: true,
value: false
}
};
}
},
customStyle = html`
visibilityFixture = html`
<custom-style>
<style include="iron-flex iron-positioning">
cosmoz-data-nav {
Expand Down
4 changes: 2 additions & 2 deletions test/resizable.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {

import sinon from 'sinon';

import { customStyle } from './helpers/utils.js';
import { visibilityFixture } from './helpers/utils.js';

import '../cosmoz-data-nav.js';
import './helpers/cosmoz-data-nav-resizable-view.js';
Expand All @@ -30,7 +30,7 @@ suite('resizable', () => {

suiteSetup(async () => {
[, nav] = await Promise.all([
fixture(customStyle),
fixture(visibilityFixture),
fixture(html`
<cosmoz-data-nav>
<template>
Expand Down
8 changes: 4 additions & 4 deletions test/spec.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
import '../cosmoz-data-nav.js';
import './helpers/cosmoz-data-nav-test-view.js';
import {
flushRenderQueue, selectedSlide, customStyle
flushRenderQueue, selectedSlide, visibilityFixture
} from './helpers/utils';
import { flush as syncFlush } from '@polymer/polymer/lib/utils/flush';

Expand Down Expand Up @@ -37,7 +37,7 @@ suite('constructor', () => {
suite('template', () => {
test('renders items using a template', async () => {
const [, nav] = await Promise.all([
fixture(customStyle),
fixture(visibilityFixture),
fixture(basicFixture)
]);
nav._templatesObserver.flush();
Expand All @@ -51,7 +51,7 @@ suite('template', () => {
test('renders the wrong item if the templates observer runs after `items` is set [KNOWN BUG]', async () => {
//expect(async () => {
const [, nav] = await Promise.all([
fixture(customStyle),
fixture(visibilityFixture),
fixture(basicFixture)
]);
nav.items = [{ id: 1 }, { id: 2 }, { id: 3 }];
Expand All @@ -70,7 +70,7 @@ suite('properties', () => {
let nav;
setup(async () => {
[, nav] = await Promise.all([
fixture(customStyle),
fixture(visibilityFixture),
fixture(basicFixture)
]);
nav._templatesObserver.flush();
Expand Down

0 comments on commit 111e122

Please sign in to comment.