use crate::{
    codegen::SvgDocument,
    types::nodes::{primitives::blend::BlendMode, standard_input::StandardInput},
};

#[test]
fn test_offset_blend() {
    let mut doc = SvgDocument::new();

    let blend = doc.create_filter("blend");

    let offset0 = blend.offset(StandardInput::SourceGraphic, 100., 0.);
    let offset1 = blend.offset(StandardInput::SourceGraphic, -100., 0.);
    blend.blend(offset0, offset1, BlendMode::Multiply);

    assert_eq!(
        doc.generate_svg(),
        r#"<svg><filter id="blend"><feOffset dx="-100" dy="0" in="SourceGraphic" result="r7"/><feOffset dx="100" dy="0" in="SourceGraphic" result="r6"/><feBlend mode="multiply" in="r6" in2="r7"/></filter></svg>"#
    );
}
